Order of watch events happening in the same revision in the same watcher is not documented #19736
-
It's not clear which order of watch events is guaranteed (or not guaranteed) in the same revision in the same watcher. Support I watch prefix EDIT: Experiment says, that the order of watched events is the same as it was in TXN block. But if it is not said in the docs then it may be changed in the future (i.e. implementation specific). Strictly speaking, since keys in TXN success (or TXN failure) block can not intersect, order of operations does not have any meaning. I don't know, possibly order of records in watcher may be changed after compaction. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
/cc @fuweid |
Beta Was this translation helpful? Give feedback.
-
You are exactly right. Order is based on order of operation in TXN and it should not matter due to lack of intersection.
After compaction it should not matter as you no longer can access/watch from this revision. Still if you looked under the hood, you would find that etcd assigns TXN operations a sequence number called subrevision. This should ensure that etcd always maintains order of operations in TXN |
Beta Was this translation helpful? Give feedback.
-
Okay, but it is not documented. It's impossible to get it reading documentation. I would add that the order of operations in TXN is preserved and makes sense for watching them. |
Beta Was this translation helpful? Give feedback.
You are exactly right. Order is based on order of operation in TXN and it should not matter due to lack of intersection.
After compaction it should not matter as you no longer can access/watch from this revision. Still if you looked under the hood, you would find that etcd assigns TXN …