-
Notifications
You must be signed in to change notification settings - Fork 24.6k
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
Verify shards index UUID when fetching started shards #10200
Conversation
@bleskes wanna take a look |
public ActionFuture<NodesGatewayStartedShards> list(ShardId shardId, String[] nodesIds, @Nullable TimeValue timeout) { | ||
return execute(new Request(shardId, nodesIds).timeout(timeout)); | ||
public ActionFuture<NodesGatewayStartedShards> list(ShardId shardId, String indexUUID, String[] nodesIds, @Nullable TimeValue timeout) { | ||
return execute(new Request(shardId, indexUUID, Arrays.asList(nodesIds)).timeout(timeout)); |
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 think the nodes can stay as an array. The constructor just converts to an array again.
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.
yeah so I did this since I didn't want the String, String...
signature.. kind of confusing
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.
agreed, but what's wrong with Request(ShardId shardId, String[] nodesIds) ?
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.
true :) will fix
Left one minor comment. LGTM otherwise. |
pushed a new commit |
Today we simply fetch the shards metadata without verifying the index UUID the shard belongs to. We recently added this UUID to the shard state metadata. This commit adds verification to the shard metadata fetching to prevent bringing shards back into an index it doesn't belong to due to name collisions.
LGTMx2 |
Today we simply fetch the shards metadata without verifying the
index UUID the shard belongs to. We recently added this UUID
to the shard state metadata. This commit adds verification
to the shard metadata fetching to prevent bringing shards
back into an index it doesn't belong to due to name collisions.