Add sequence numbers based optimistic concurrency control support to Engine#36467
Add sequence numbers based optimistic concurrency control support to Engine#36467bleskes merged 7 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-distributed |
s1monw
left a comment
There was a problem hiding this comment.
LGTM - I am not happy with the naming. I think cas should not be in there. Can we just name them expectedSeqId expectedPrimaryTerm for now? That's what for instance Integer.compareAndSet uses as it's parameter names.
| final long seqNo; | ||
| final long term; | ||
| if (loadSeqNo) { | ||
| NumericDocValues seqNos = context.reader().getNumericDocValues(SeqNoFieldMapper.NAME); |
There was a problem hiding this comment.
we should clean this up in master once backported. can you put a comment in there?
server/src/test/java/org/elasticsearch/index/engine/InternalEngineTests.java
Outdated
Show resolved
Hide resolved
014528f to
594bf52
Compare
|
run gradle build tests 1 |
|
The build failure was regarding refresh listeners. I don't think it's a related but probably signals a concurrency bug. I tried to reproduce this without success (I run ~300 time). Capturing the info here in case it's needed. |
Similar assertion recently failed on master (#24418 (comment)), so looks to be unrelated to your changes here |
|
run gradle build tests 1 |
…Engine (elastic#36467) This commit add support to engine operations for resolving and verifying the sequence number and primary term of the last modification to a document before performing an operation. This is infrastructure to move our (optimistic concurrency control)[http://en.wikipedia.org/wiki/Optimistic_concurrency_control] API to use sequence numbers instead of internal versioning. Relates elastic#36148 Relates elastic#10708
…Engine (#36467) This commit add support to engine operations for resolving and verifying the sequence number and primary term of the last modification to a document before performing an operation. This is infrastructure to move our (optimistic concurrency control)[http://en.wikipedia.org/wiki/Optimistic_concurrency_control] API to use sequence numbers instead of internal versioning. Relates #36148 Relates #10708
The assertion `assertOpsOnPrimary` does not store seq_no and primary term of successful deletes to the `lastOpSeqNo` and `lastOpTerm`. This leads to failures of the subsequence CAS deletes or indexes with seq_no and term. Moreover, this assertion trips a translog assertion because it bumps the primary term of some operations but not the primary term of the engine. Relates elastic#36467 Closes elastic#37684
The assertion `assertOpsOnPrimary` does not store seq_no and primary term of successful deletes to the `lastOpSeqNo` and `lastOpTerm`. This leads to failures of the subsequence CAS deletes or indexes with seq_no and term. Moreover, this assertion trips a translog assertion because it bumps the primary term of some operations but not the primary term of the engine. Relates #36467 Closes #37684
The assertion `assertOpsOnPrimary` does not store seq_no and primary term of successful deletes to the `lastOpSeqNo` and `lastOpTerm`. This leads to failures of the subsequence CAS deletes or indexes with seq_no and term. Moreover, this assertion trips a translog assertion because it bumps the primary term of some operations but not the primary term of the engine. Relates #36467 Closes #37684
The assertion `assertOpsOnPrimary` does not store seq_no and primary term of successful deletes to the `lastOpSeqNo` and `lastOpTerm`. This leads to failures of the subsequence CAS deletes or indexes with seq_no and term. Moreover, this assertion trips a translog assertion because it bumps the primary term of some operations but not the primary term of the engine. Relates elastic#36467 Closes elastic#37684
The assertion `assertOpsOnPrimary` does not store seq_no and primary term of successful deletes to the `lastOpSeqNo` and `lastOpTerm`. This leads to failures of the subsequence CAS deletes or indexes with seq_no and term. Moreover, this assertion trips a translog assertion because it bumps the primary term of some operations but not the primary term of the engine. Relates #36467 Closes #37684
Changes were made in elastic#34357 and elastic#36467
This PR add support to engine operations for resolving and verifying the sequence number and primary term of the last modification to a document before performing an operation. This is infrastructure to move our optimistic concurrency control API to use sequence numbers instead of internal versioning.
Relates #36148
Relates #10708
PS there are still discussions about the parameter naming. I'll rename these once we have settled on something.