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
SOLR-14702: Remove oppressive language (part1) #1712
Changes from 2 commits
f9c1870
fb3bdd5
f26ab19
8f915e0
3303ab5
51dc39c
d809913
0d7b063
bc94423
f9ca9ce
6b1c8dd
670f464
0b41c30
a040ef1
987e838
ad25d07
b0f4af7
768c2eb
8c9aba7
fbc9cf6
ce157e0
740e516
e2e92ba
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 |
---|---|---|
|
@@ -169,7 +169,7 @@ public class IndexFetcher { | |
|
||
private boolean downloadTlogFiles = false; | ||
|
||
private boolean skipCommitOnMasterVersionZero = true; | ||
private boolean skipCommitOnPrimaryVersionZero = true; | ||
|
||
private boolean clearLocalIndexFirst = false; | ||
|
||
|
@@ -236,9 +236,9 @@ public IndexFetcher(@SuppressWarnings({"rawtypes"})final NamedList initArgs, fin | |
if (fetchFromLeader != null && fetchFromLeader instanceof Boolean) { | ||
this.fetchFromLeader = (boolean) fetchFromLeader; | ||
} | ||
Object skipCommitOnMasterVersionZero = initArgs.get(SKIP_COMMIT_ON_MASTER_VERSION_ZERO); | ||
if (skipCommitOnMasterVersionZero != null && skipCommitOnMasterVersionZero instanceof Boolean) { | ||
this.skipCommitOnMasterVersionZero = (boolean) skipCommitOnMasterVersionZero; | ||
Object skipCommitOnPrimaryVersionZero = initArgs.get(SKIP_COMMIT_ON_MASTER_VERSION_ZERO); | ||
if (skipCommitOnPrimaryVersionZero != null && skipCommitOnPrimaryVersionZero instanceof Boolean) { | ||
this.skipCommitOnPrimaryVersionZero = (boolean) skipCommitOnPrimaryVersionZero; | ||
} | ||
String masterUrl = (String) initArgs.get(MASTER_URL); | ||
if (masterUrl == null && !this.fetchFromLeader) | ||
|
@@ -420,19 +420,19 @@ IndexFetchResult fetchLatestIndex(boolean forceReplication, boolean forceCoreRel | |
} catch (Exception e) { | ||
final String errorMsg = e.toString(); | ||
if (!Strings.isNullOrEmpty(errorMsg) && errorMsg.contains(INTERRUPT_RESPONSE_MESSAGE)) { | ||
log.warn("Master at: {} is not available. Index fetch failed by interrupt. Exception: {}", masterUrl, errorMsg); | ||
log.warn("Primary at: {} is not available. Index fetch failed by interrupt. Exception: {}", masterUrl, errorMsg); | ||
return new IndexFetchResult(IndexFetchResult.FAILED_BY_INTERRUPT_MESSAGE, false, e); | ||
} else { | ||
log.warn("Master at: {} is not available. Index fetch failed by exception: {}", masterUrl, errorMsg); | ||
log.warn("Primary at: {} is not available. Index fetch failed by exception: {}", masterUrl, errorMsg); | ||
return new IndexFetchResult(IndexFetchResult.FAILED_BY_EXCEPTION_MESSAGE, false, e); | ||
} | ||
} | ||
|
||
long latestVersion = (Long) response.get(CMD_INDEX_VERSION); | ||
long latestGeneration = (Long) response.get(GENERATION); | ||
|
||
log.info("Master's generation: {}", latestGeneration); | ||
log.info("Master's version: {}", latestVersion); | ||
log.info("Primary's generation: {}", latestGeneration); | ||
log.info("Primary's version: {}", latestVersion); | ||
Comment on lines
+434
to
+435
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. To my point, all these log in IndexFetcher talk about Master/Primary even when running in SolrCloud mode. This is likely adding to the confusion that Shawn talked about in the Jira. If these were "leader"/"Follower", we'd have solve it :) 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. gothca 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. Shawn suggested that we shouldn't use the same terminology for the legacy architecture. I've updated the first PR in any event. At this time, keeping the same terminology seems to be the right way to go unless I rewrite the replication handler. There's an argument for that because I'm sure there are areas where we could improve, but it won't happen in this PR. |
||
|
||
// TODO: make sure that getLatestCommit only returns commit points for the main index (i.e. no side-car indexes) | ||
IndexCommit commit = solrCore.getDeletionPolicy().getLatestCommit(); | ||
|
@@ -453,23 +453,23 @@ IndexFetchResult fetchLatestIndex(boolean forceReplication, boolean forceCoreRel | |
} | ||
|
||
if (log.isInfoEnabled()) { | ||
log.info("Slave's generation: {}", commit.getGeneration()); | ||
log.info("Slave's version: {}", IndexDeletionPolicyWrapper.getCommitTimestamp(commit)); // logOK | ||
log.info("Secondary's generation: {}", commit.getGeneration()); | ||
log.info("Secondary's version: {}", IndexDeletionPolicyWrapper.getCommitTimestamp(commit)); // logOK | ||
} | ||
|
||
if (latestVersion == 0L) { | ||
if (commit.getGeneration() != 0) { | ||
// since we won't get the files for an empty index, | ||
// we just clear ours and commit | ||
log.info("New index in Master. Deleting mine..."); | ||
log.info("New index in Primary. Deleting mine..."); | ||
RefCounted<IndexWriter> iw = solrCore.getUpdateHandler().getSolrCoreState().getIndexWriter(solrCore); | ||
try { | ||
iw.get().deleteAll(); | ||
} finally { | ||
iw.decref(); | ||
} | ||
assert TestInjection.injectDelayBeforeSlaveCommitRefresh(); | ||
if (skipCommitOnMasterVersionZero) { | ||
assert TestInjection.injectDelayBeforeSecondaryCommitRefresh(); | ||
if (skipCommitOnPrimaryVersionZero) { | ||
openNewSearcherAndUpdateCommitPoint(); | ||
} else { | ||
SolrQueryRequest req = new LocalSolrQueryRequest(solrCore, new ModifiableSolrParams()); | ||
|
@@ -486,7 +486,7 @@ IndexFetchResult fetchLatestIndex(boolean forceReplication, boolean forceCoreRel | |
// TODO: Should we be comparing timestamps (across machines) here? | ||
if (!forceReplication && IndexDeletionPolicyWrapper.getCommitTimestamp(commit) == latestVersion) { | ||
//master and slave are already in sync just return | ||
log.info("Slave in sync with master."); | ||
log.info("Secondary in sync with master."); | ||
successfulInstall = true; | ||
return IndexFetchResult.ALREADY_IN_SYNC; | ||
} | ||
|
@@ -1998,7 +1998,7 @@ public void destroy() { | |
HttpClientUtil.close(myHttpClient); | ||
} | ||
|
||
String getMasterUrl() { | ||
String getPrimaryUrl() { | ||
return masterUrl; | ||
} | ||
|
||
|
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.
Missing an update here? Also, since you changed the parameter used, this needs to handle back compatibility
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 this is the only one that needs to change, possibly. Still stitching it all together.
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.
It doesn't have to handle back-compat in this PR. I can commit to it prior to 9.0's release and even prioritize the work before opening PRs on the other work I am doing.