-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
[Remote Store] Add index specific setting for remote repository #4253
Changes from all commits
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 |
---|---|---|
|
@@ -560,6 +560,7 @@ public final class IndexSettings { | |
private final ReplicationType replicationType; | ||
private final boolean isRemoteStoreEnabled; | ||
private final boolean isRemoteTranslogStoreEnabled; | ||
private final String remoteStoreRepository; | ||
// volatile fields are updated via #updateIndexMetadata(IndexMetadata) under lock | ||
private volatile Settings settings; | ||
private volatile IndexMetadata indexMetadata; | ||
|
@@ -721,6 +722,7 @@ public IndexSettings(final IndexMetadata indexMetadata, final Settings nodeSetti | |
replicationType = ReplicationType.parseString(settings.get(IndexMetadata.SETTING_REPLICATION_TYPE)); | ||
isRemoteStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_STORE_ENABLED, false); | ||
isRemoteTranslogStoreEnabled = settings.getAsBoolean(IndexMetadata.SETTING_REMOTE_TRANSLOG_STORE_ENABLED, false); | ||
remoteStoreRepository = settings.get(IndexMetadata.SETTING_REMOTE_STORE_REPOSITORY); | ||
this.searchThrottled = INDEX_SEARCH_THROTTLED.get(settings); | ||
this.queryStringLenient = QUERY_STRING_LENIENT_SETTING.get(settings); | ||
this.queryStringAnalyzeWildcard = QUERY_STRING_ANALYZE_WILDCARD.get(nodeSettings); | ||
|
@@ -979,6 +981,13 @@ public boolean isRemoteTranslogStoreEnabled() { | |
return isRemoteTranslogStoreEnabled; | ||
} | ||
|
||
/** | ||
* Returns if remote store is enabled for this index. | ||
*/ | ||
public String getRemoteStoreRepository() { | ||
return remoteStoreRepository; | ||
} | ||
|
||
Comment on lines
+986
to
+990
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Does it come with a default? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No, it would be |
||
/** | ||
* Returns the node settings. The settings returned from {@link #getSettings()} are a merged version of the | ||
* index settings and the node settings where node settings are overwritten by index settings. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,13 @@ public RemoteStoreRefreshListener(IndexShard indexShard) { | |
.getDelegate()).getDelegate(); | ||
this.primaryTerm = indexShard.getOperationPrimaryTerm(); | ||
localSegmentChecksumMap = new HashMap<>(); | ||
if (indexShard.shardRouting.primary()) { | ||
try { | ||
this.remoteDirectory.init(); | ||
} catch (IOException e) { | ||
logger.error("Exception while initialising RemoteSegmentStoreDirectory", e); | ||
} | ||
} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code block is added to address bug mentioned here: #4398
Comment on lines
+62
to
+68
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this logic be sitting inside There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is present in initialization of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let me think more on abstracting out |
||
} | ||
|
||
@Override | ||
|
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.
Do we need to validate if the repository is valid and exists essentially checking against all the list of registered repositories
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.
Yes, we can add that check. Index creation will anyway fail if repository does not exist but it will take time to fail and will not provide helpful error message.
Let me add a check for repository 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.
@Bukhtawar To check against actual repository, we need to inject
RepositoriesService
intoIndexMetadata
whose builder/constructor mostly takes index settings related parameters (likenumberOfShards
,requireFilters
,indexCreatedVersion
). IMO, RepositoriesService injection would be an outlier. Need to think more on that. What do you think?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.
We might have to support overloaded constructor or builders since I believe now we are associating a new attribute to IndexMetadata?
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 have created a tracking issue here to handle this: #4403
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.
Mandatorily passing a remote store repo per index seems to be adding a lot of friction.
Thinking out loud, how does this durability semantics work if one index has HDFS other has S3. I am not quite sure if this would complicate things in future.
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.
Got it. Created tracking issue here: #4409