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

Adjust translog operation assertions for synthetic source #119330

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dnhatn
Copy link
Member

@dnhatn dnhatn commented Dec 27, 2024

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

@dnhatn dnhatn force-pushed the relax-translog-assertion branch 2 times, most recently from 50240da to 8206042 Compare December 28, 2024 03:16
@dnhatn dnhatn force-pushed the relax-translog-assertion branch from 8206042 to b521d7d Compare December 28, 2024 03:21
@dnhatn dnhatn added :StorageEngine/Logs You know, for Logs >non-issue auto-backport Automatically create backport pull requests when merged v8.18.0 labels Dec 28, 2024
@dnhatn dnhatn marked this pull request as ready for review December 28, 2024 03:31
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-storage-engine (Team:StorageEngine)

Copy link
Member

@martijnvg martijnvg left a 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 {
Copy link
Member

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, () -> {})) {
Copy link
Member

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 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged >non-issue :StorageEngine/Logs You know, for Logs Team:StorageEngine v8.18.0 v9.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] SmokeTestMultiNodeClientYamlTestSuiteIT class failing
3 participants