Skip to content

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

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 🆗

// 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 Indexing/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 Indexing/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.

5 participants