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

Initialize checkpoint tracker with allocation ID #26630

Merged

Conversation

jasontedor
Copy link
Member

This commit pushes the allocation ID down through to the global checkpoint tracker at construction rather than when activated as a primary.

Relates #26591

This commit pushes the allocation ID down through to the global
checkpoint tracker at construction rather than when activated as a
primary.
Copy link
Contributor

@ywelsch ywelsch left a 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();
Copy link
Contributor

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();

Copy link
Member Author

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. 😐

Copy link
Contributor

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(
Copy link
Contributor

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.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I pushed e69b8d9.

@jasontedor jasontedor merged commit 7be5ee5 into elastic:master Sep 13, 2017
jasontedor added a commit that referenced this pull request Sep 13, 2017
This commit pushes the allocation ID down through to the global
checkpoint tracker at construction rather than when activated as a
primary.

Relates #26630
jasontedor added a commit that referenced this pull request Sep 13, 2017
This commit pushes the allocation ID down through to the global
checkpoint tracker at construction rather than when activated as a
primary.

Relates #26630
@jasontedor jasontedor deleted the global-checkpoint-tracker-allocation-id branch September 13, 2017 16:19
@jasontedor
Copy link
Member Author

Thanks @ywelsch.

@lcawl lcawl removed the v6.1.0 label Dec 12, 2017
@clintongormley clintongormley added :Distributed/Engine Anything around managing Lucene and the Translog in an open shard. and removed :Sequence IDs labels Feb 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Distributed/Engine Anything around managing Lucene and the Translog in an open shard. >non-issue v6.0.0-rc1 v7.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants