Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Sequence Numbers powered Compare and Set operations #36148

Closed
wants to merge 49 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
fed3cb9
initial version
bleskes Oct 5, 2018
c6fca4c
lint
bleskes Oct 5, 2018
97d407b
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Oct 7, 2018
a91d18f
adapted test
bleskes Oct 8, 2018
60680ae
lint
bleskes Oct 8, 2018
c177f27
initial rest parsing
bleskes Oct 8, 2018
f8645ae
fix version test
bleskes Oct 8, 2018
17d4c5a
fix validation
bleskes Oct 8, 2018
24fbaeb
magic numbers are tricky
bleskes Oct 9, 2018
b57e9a0
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Oct 10, 2018
d7ffbe2
seq# on delete fix
bleskes Oct 10, 2018
903cef5
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Oct 10, 2018
d3badd7
fix rest params
bleskes Oct 11, 2018
9a837db
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Oct 13, 2018
c7917c1
rest tests
bleskes Oct 13, 2018
93bb437
compile
bleskes Oct 13, 2018
96fb99e
fix rest
bleskes Oct 14, 2018
12316f0
rest doc
bleskes Oct 14, 2018
005c477
fix rest
bleskes Oct 14, 2018
d7c5451
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Oct 16, 2018
11ad5fa
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Oct 19, 2018
0bcb1dd
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Nov 12, 2018
d59712d
fix compilation issues
bleskes Nov 12, 2018
c139f7d
iter
bleskes Nov 14, 2018
0c62332
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Nov 15, 2018
d2b6b6d
fix get response tests
bleskes Nov 15, 2018
1cb3faa
updates should use the right seq no info
bleskes Nov 15, 2018
c87530d
line length
bleskes Nov 15, 2018
3ae2168
Merge remote-tracking branch 'upstream/master' into opt_seq_no
bleskes Nov 16, 2018
4e20e2b
compile
bleskes Nov 17, 2018
73c5618
Merge remote-tracking branch 'upstream/master' into cas_seq_no
bleskes Nov 29, 2018
95d6c6a
lint
bleskes Nov 29, 2018
1c0f81f
compilation
bleskes Nov 29, 2018
97db90a
lint
bleskes Nov 29, 2018
a6d9ef6
fix UpdateRequestTests
bleskes Nov 29, 2018
7f2d0d5
render seq# with get results of updates.
bleskes Nov 30, 2018
97ba1fb
fix RestGetSourceActionTests
bleskes Nov 30, 2018
f673e83
woops
bleskes Nov 30, 2018
593ddf2
fix wrong ordering
bleskes Nov 30, 2018
ed47866
doc fixes
bleskes Nov 30, 2018
446a2fb
Merge remote-tracking branch 'upstream/master' into cas_seq_no
bleskes Dec 2, 2018
dae469e
Merge remote-tracking branch 'upstream/master' into cas_seq_no
bleskes Dec 6, 2018
a7d3fb2
merge from master
bleskes Dec 10, 2018
7a4d87e
Merge remote-tracking branch 'upstream/master' into cas_seq_no
bleskes Dec 11, 2018
7e787af
merge from master
bleskes Dec 13, 2018
5d688fb
move to if_*_match
bleskes Dec 13, 2018
352196e
fix compilation
bleskes Dec 13, 2018
bf62361
lint
bleskes Dec 13, 2018
37d1187
merge from master
bleskes Dec 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix compilation issues
  • Loading branch information
bleskes committed Nov 12, 2018
commit d59712d0149b26875bad7b4d8d58047681a022b6
Original file line number Diff line number Diff line change
@@ -229,7 +229,7 @@ public void readFrom(StreamInput in) throws IOException {
}
version = in.readLong();
versionType = VersionType.fromValue(in.readByte());
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
casSeqNp = in.readZLong();
casPrimaryTerm = in.readVLong();
} else {
@@ -249,7 +249,7 @@ public void writeTo(StreamOutput out) throws IOException {
}
out.writeLong(version);
out.writeByte(versionType.getValue());
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
out.writeZLong(casSeqNp);
out.writeVLong(casPrimaryTerm);
} else if (casSeqNp != SequenceNumbers.UNASSIGNED_SEQ_NO || casPrimaryTerm != 0) {
Original file line number Diff line number Diff line change
@@ -577,7 +577,7 @@ public void readFrom(StreamInput in) throws IOException {
} else {
contentType = null;
}
if (in.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (in.getVersion().onOrAfter(Version.V_7_0_0)) {
casSeqNo = in.readZLong();
casPrimaryTerm = in.readVLong();
} else {
@@ -615,7 +615,7 @@ public void writeTo(StreamOutput out) throws IOException {
} else {
out.writeBoolean(false);
}
if (out.getVersion().onOrAfter(Version.V_7_0_0_alpha1)) {
if (out.getVersion().onOrAfter(Version.V_7_0_0)) {
out.writeZLong(casSeqNo);
out.writeVLong(casPrimaryTerm);
} else if (casSeqNo != SequenceNumbers.UNASSIGNED_SEQ_NO || casPrimaryTerm != 0) {
Original file line number Diff line number Diff line change
@@ -3745,10 +3745,12 @@ public void testLookupSeqNoByIdInLucene() throws Exception {
final ParsedDocument doc = EngineTestCase.createParsedDoc(id, null);
if (isIndexing) {
operations.add(new Engine.Index(EngineTestCase.newUid(doc), doc, seqNo, primaryTerm.get(),
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis(), -1, true));
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis(), -1, true,
UNASSIGNED_SEQ_NO, 0L));
} else {
operations.add(new Engine.Delete(doc.type(), doc.id(), EngineTestCase.newUid(doc), seqNo, primaryTerm.get(),
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis()));
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis(),
UNASSIGNED_SEQ_NO, 0L));
}
}
seqNo++;
@@ -3774,7 +3776,7 @@ public void testLookupSeqNoByIdInLucene() throws Exception {
assertThat(msg, docIdAndSeqNo.isLive, equalTo(latestOps.get(id).operationType() == Engine.Operation.TYPE.INDEX));
}
assertThat(VersionsAndSeqNoResolver.loadDocIdAndVersion(
searcher.reader(), newUid("any-" + between(1, 10))), nullValue());
searcher.reader(), newUid("any-" + between(1, 10)), randomBoolean()), nullValue());
Map<String, Long> liveOps = latestOps.entrySet().stream()
.filter(e -> e.getValue().operationType() == Engine.Operation.TYPE.INDEX)
.collect(Collectors.toMap(e -> e.getKey(), e -> e.getValue().seqNo()));
@@ -5281,10 +5283,12 @@ public void testRebuildLocalCheckpointTracker() throws Exception {
final ParsedDocument doc = EngineTestCase.createParsedDoc(Integer.toString(between(1, 100)), null);
if (randomBoolean()) {
operations.add(new Engine.Index(EngineTestCase.newUid(doc), doc, seqNo, primaryTerm.get(),
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis(), -1, true));
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis(), -1, true,
UNASSIGNED_SEQ_NO, 0L));
} else if (randomBoolean()) {
operations.add(new Engine.Delete(doc.type(), doc.id(), EngineTestCase.newUid(doc), seqNo, primaryTerm.get(),
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis()));
i, null, Engine.Operation.Origin.REPLICA, threadPool.relativeTimeInMillis(),
UNASSIGNED_SEQ_NO, 0L));
} else {
operations.add(new Engine.NoOp(seqNo, primaryTerm.get(), Engine.Operation.Origin.REPLICA,
threadPool.relativeTimeInMillis(), "test-" + i));