-
Notifications
You must be signed in to change notification settings - Fork 25.1k
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
Initialize checkpoint tracker with allocation ID #26630
Initialize checkpoint tracker with allocation ID #26630
Conversation
This commit pushes the allocation ID down through to the global checkpoint tracker at construction rather than when activated as a primary.
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
@@ -198,6 +200,7 @@ | |||
public class InternalEngineTests extends ESTestCase { | |||
|
|||
protected final ShardId shardId = new ShardId(new Index("index", "_na_"), 0); | |||
protected final AllocationId allocationId = AllocationId.newInitializing(); |
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.
maybe just store the string here, i.e.
protected final String allocationId = AllocationId.newInitializing().getId();
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.
The actual allocation ID instance is needed in one place. 😐
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.
ok 🆗
@@ -117,6 +108,11 @@ public void testGlobalCheckpointUpdate() { | |||
// it is however nice not to assume this on this level and check we do the right thing. | |||
final long minLocalCheckpoint = allocations.values().stream().min(Long::compare).orElse(UNASSIGNED_SEQ_NO); | |||
|
|||
final GlobalCheckpointTracker tracker = new GlobalCheckpointTracker( |
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.
maybe add a helper method newTracker(String allocationId)
, so that there is less code repetition.
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 pushed e69b8d9.
This commit pushes the allocation ID down through to the global checkpoint tracker at construction rather than when activated as a primary. Relates #26630
This commit pushes the allocation ID down through to the global checkpoint tracker at construction rather than when activated as a primary. Relates #26630
Thanks @ywelsch. |
This commit pushes the allocation ID down through to the global checkpoint tracker at construction rather than when activated as a primary.
Relates #26591