Skip to content

Wait for global checkpoint update before retrieving shard changes #119128

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

salvatore-campagna
Copy link
Contributor

@salvatore-campagna salvatore-campagna commented Dec 19, 2024

This PR addresses a race condition in a test that interacts with the shardChanges API. The test now explicitly waits for the global checkpoint to be updated to a non-negative value before proceeding. This prevents potential timeouts that could occur when the requested seq_no (0) is greater than the initial global checkpoint value. The fix utilizes the shard stats API to monitor the global checkpoint and ensures that the shardChanges API call is made only when the checkpoint is at least 0.

Resolves #118800

@salvatore-campagna salvatore-campagna self-assigned this Dec 19, 2024
@salvatore-campagna salvatore-campagna changed the title Qait for global checkpoint update before retrieving shard changes Wait for global checkpoint update before retrieving shard changes Dec 19, 2024
@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

@salvatore-campagna
Copy link
Contributor Author

I evaluated the option to use ensureGreen(indexName) but a green cluster does not guarantee that the global checkpoint is reached.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] ShardChangesRestIT testShardChangesNoOperation failing
3 participants