-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Don't persist type information to translog #47229
Conversation
Pinging @elastic/es-distributed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great. Thanks, @romseygeek.
I left two comments relating to BWC in translog. I will need some time to look carefully at other files.
server/src/main/java/org/elasticsearch/index/translog/Translog.java
Outdated
Show resolved
Hide resolved
server/src/main/java/org/elasticsearch/index/translog/Translog.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks, @romseygeek for your huge effort. I left two smaller comments.
@@ -155,7 +155,7 @@ public void testResyncDoesNotBlockOnPrimaryAction() throws Exception { | |||
|
|||
final byte[] bytes = "{}".getBytes(Charset.forName("UTF-8")); | |||
final ResyncReplicationRequest request = new ResyncReplicationRequest(shardId, 42L, 100, | |||
new Translog.Operation[]{new Translog.Index("type", "id", 0, primaryTerm, 0L, bytes, null, -1)}); | |||
new Translog.Operation[]{new Translog.Index("type", 0, primaryTerm, 0L, bytes, null, -1)}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should keep "id" instead of "type" here.
@@ -83,7 +83,7 @@ private void applyOperation(Engine engine, Engine.Operation operation) throws IO | |||
Engine.Index engineIndex = (Engine.Index) operation; | |||
Mapping update = engineIndex.parsedDoc().dynamicMappingsUpdate(); | |||
if (engineIndex.parsedDoc().dynamicMappingsUpdate() != null) { | |||
recoveredTypes.compute(engineIndex.type(), (k, mapping) -> mapping == null ? update : mapping.merge(update)); | |||
recoveredTypes.compute("", (k, mapping) -> mapping == null ? update : mapping.merge(update)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should remove "recoveredTypes" and adjust the related tests.
Thanks @dnhatn, I pushed a change removing |
@elasticmachine update branch |
We no longer need to store type information in the translog, given that an index
can only have a single type.
Relates to #41059