-
Notifications
You must be signed in to change notification settings - Fork 25.8k
Make static Store access shard lock aware #19416
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
Changes from 3 commits
b13c0bc
37e0668
d68991a
896455a
b174474
d9bedf3
e7d2d7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -150,7 +150,10 @@ private StoreFilesMetaData listStoreMetaData(ShardId shardId) throws IOException | |
| if (shardPath == null) { | ||
| return new StoreFilesMetaData(shardId, Store.MetadataSnapshot.EMPTY); | ||
| } | ||
| return new StoreFilesMetaData(shardId, Store.readMetadataSnapshot(shardPath.resolveIndex(), shardId, logger)); | ||
| // note that this may fail if it can't get access to the shard lock. Since we check above there is an active shard, this means: | ||
| // 1) a shard is being constructed, which means the master will not use a copy of this replcia | ||
|
||
| return new StoreFilesMetaData(shardId, Store.readMetadataSnapshot(shardPath.resolveIndex(), shardId, | ||
| nodeEnv::shardLock, logger)); | ||
| } finally { | ||
| TimeValue took = new TimeValue(System.nanoTime() - startTimeNS, TimeUnit.NANOSECONDS); | ||
| if (exists) { | ||
|
|
||
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.
can we move this into NodeEnv instead?
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.
sure