-
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
Adjust translog operation assertions for synthetic source #119330
base: main
Are you sure you want to change the base?
Conversation
50240da
to
8206042
Compare
8206042
to
b521d7d
Compare
Pinging @elastic/es-storage-engine (Team:StorageEngine) |
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 from my side. I think distributed team should review this as well.
* A utility class to assert that translog operations with the same sequence number | ||
* in the same generation are either identical or equivalent when synthetic sources are used. | ||
*/ | ||
public abstract class TranslogOperationAsserter { |
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.
Should there be a dedicated unit test class for TranslogOperationAsserter
?
final ShardId shardId = engineConfig.getShardId(); | ||
MappingLookup mappingLookup = engineConfig.getMapperService().mappingLookup(); | ||
DocumentParser documentParser = engineConfig.getMapperService().documentParser(); | ||
try (var reader = new TranslogDirectoryReader(shardId, op, mappingLookup, documentParser, engineConfig, () -> {})) { |
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.
nice, I was wondering whether opening a translog as a Lucene index was possible. This is direction I was thinking as well 👍
When synthetic sources are used in peer recoveries, the translog operations via peer recoveries may differ from those created through replication. This change relaxes the translog operation assertion to account for synthetic source, allowing these operations to be considered equivalent.
Closes #119191