Skip to content

Conversation

@romseygeek
Copy link
Contributor

We no longer need to store type information in the translog, given that an index
can only have a single type.

Relates to #41059

@romseygeek romseygeek added :Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >refactoring v8.0.0 labels Sep 27, 2019
@romseygeek romseygeek requested a review from dnhatn September 27, 2019 15:43
@romseygeek romseygeek self-assigned this Sep 27, 2019
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-distributed

Copy link
Member

@dnhatn dnhatn left a 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.

@dnhatn dnhatn self-requested a review September 30, 2019 22:08
Copy link
Member

@dnhatn dnhatn left a 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.

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)});
Copy link
Member

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.

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));
Copy link
Member

@dnhatn dnhatn Oct 14, 2019

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.

@romseygeek
Copy link
Contributor Author

Thanks @dnhatn, I pushed a change removing recoveredTypes, and also TranslogHandler.mappingUpdate which only seemed to be set by tests.

@romseygeek
Copy link
Contributor Author

@elasticmachine update branch

@romseygeek romseygeek merged commit 6531369 into elastic:master Oct 15, 2019
@romseygeek romseygeek deleted the types-removal/translog branch October 15, 2019 08:05
@jpountz jpountz mentioned this pull request Oct 15, 2019
66 tasks
@pgomulka pgomulka mentioned this pull request Mar 25, 2020
66 tasks
dnhatn added a commit that referenced this pull request Jul 7, 2020
We stopped persisting the doctype in translog since #47229. We should 
also stop storing the uid as we can construct it from the single mapping
doctype and the id.

Relates #47229
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Indexing/Engine Anything around managing Lucene and the Translog in an open shard. >refactoring v8.0.0-alpha1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants