tflobbe commented on a change in pull request #1712:
URL: https://github.com/apache/lucene-solr/pull/1712#discussion_r464791347
##########
File path: solr/core/src/java/org/apache/solr/cloud/RecoveryStrategy.java
##########
@@ -239,7 +239,7 @@ final private void replicate(String nodeName, SolrCore
core, ZkNodeProps leaderp
}
ModifiableSolrParams solrParams = new ModifiableSolrParams();
- solrParams.set(ReplicationHandler.MASTER_URL, leaderUrl);
+ solrParams.set(ReplicationHandler.PRIMARY_URL, leaderUrl);
solrParams.set(ReplicationHandler.SKIP_COMMIT_ON_MASTER_VERSION_ZERO,
replicaType == Replica.Type.TLOG);
Review comment:
missing master
##########
File path: solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
##########
@@ -897,14 +897,14 @@ public void initializeMetrics(SolrMetricsContext
parentContext, String scope) {
true, GENERATION, getCategory().toString(), scope);
solrMetricsContext.gauge(() -> (core != null && !core.isClosed() ?
core.getIndexDir() : ""),
true, "indexPath", getCategory().toString(), scope);
- solrMetricsContext.gauge(() -> isMaster,
- true, "isMaster", getCategory().toString(), scope);
- solrMetricsContext.gauge(() -> isSlave,
- true, "isSlave", getCategory().toString(), scope);
+ solrMetricsContext.gauge(() -> isPrimary,
+ true, "isPrimary", getCategory().toString(), scope);
+ solrMetricsContext.gauge(() -> isSecondary,
+ true, "isSecondary", getCategory().toString(), scope);
final MetricsMap fetcherMap = new MetricsMap((detailed, map) -> {
IndexFetcher fetcher = currentIndexFetcher;
if (fetcher != null) {
- map.put(MASTER_URL, fetcher.getMasterUrl());
+ map.put(PRIMARY_URL, fetcher.getPrimaryUrl());
if (getPollInterval() != null) {
map.put(POLL_INTERVAL, getPollInterval());
}
Review comment:
This part would break compatibility. Maybe we should have a way to
report both metrics? A system property maybe?
##########
File path: solr/core/src/java/org/apache/solr/handler/CdcrRequestHandler.java
##########
@@ -733,12 +733,12 @@ private void handleBootstrapStatus(SolrQueryRequest req,
SolrQueryResponse rsp)
}
static class BootstrapCallable implements Callable<Boolean>, Closeable {
- private final String masterUrl;
+ private final String primaryUrl;
Review comment:
This is in the context of SolrCloud, should be "leader"
##########
File path: solr/core/src/java/org/apache/solr/cloud/ReplicateFromLeader.java
##########
@@ -76,12 +76,12 @@ public void startReplication(boolean switchTransactionLog)
throws InterruptedExc
}
log.info("Will start replication from leader with poll interval: {}",
pollIntervalStr );
- NamedList<Object> slaveConfig = new NamedList<>();
- slaveConfig.add("fetchFromLeader", Boolean.TRUE);
- slaveConfig.add(ReplicationHandler.SKIP_COMMIT_ON_MASTER_VERSION_ZERO,
switchTransactionLog);
- slaveConfig.add("pollInterval", pollIntervalStr);
+ NamedList<Object> secondaryConfig = new NamedList<>();
+ secondaryConfig.add("fetchFromLeader", Boolean.TRUE);
+
secondaryConfig.add(ReplicationHandler.SKIP_COMMIT_ON_MASTER_VERSION_ZERO,
switchTransactionLog);
+ secondaryConfig.add("pollInterval", pollIntervalStr);
NamedList<Object> replicationConfig = new NamedList<>();
- replicationConfig.add("slave", slaveConfig);
+ replicationConfig.add("secondary", secondaryConfig);
Review comment:
Note that this is in the context of SolrCloud, so "secondary" doesn't
apply and should be instead follower
##########
File path: solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
##########
@@ -930,88 +930,88 @@ public void initializeMetrics(SolrMetricsContext
parentContext, String scope) {
}
});
solrMetricsContext.gauge(fetcherMap, true, "fetcher",
getCategory().toString(), scope);
- solrMetricsContext.gauge(() -> isMaster && includeConfFiles != null ?
includeConfFiles : "",
+ solrMetricsContext.gauge(() -> isPrimary && includeConfFiles != null ?
includeConfFiles : "",
true, "confFilesToReplicate", getCategory().toString(), scope);
- solrMetricsContext.gauge(() -> isMaster ? getReplicateAfterStrings() :
Collections.<String>emptyList(),
+ solrMetricsContext.gauge(() -> isPrimary ? getReplicateAfterStrings() :
Collections.<String>emptyList(),
true, REPLICATE_AFTER, getCategory().toString(), scope);
- solrMetricsContext.gauge( () -> isMaster && replicationEnabled.get(),
+ solrMetricsContext.gauge( () -> isPrimary && replicationEnabled.get(),
true, "replicationEnabled", getCategory().toString(), scope);
}
//TODO Should a failure retrieving any piece of info mark the overall
request as a failure? Is there a core set of values that are required to make
a response here useful?
/**
* Used for showing statistics and progress information.
*/
- private NamedList<Object> getReplicationDetails(SolrQueryResponse rsp,
boolean showSlaveDetails) {
+ private NamedList<Object> getReplicationDetails(SolrQueryResponse rsp,
boolean showSecondaryDetails) {
Review comment:
This section in general needs back compat treatment I think. Maybe given
a system property include both, the new names and the old?
##########
File path:
solr/core/src/java/org/apache/solr/search/stats/ExactSharedStatsCache.java
##########
@@ -40,7 +40,7 @@
// local stats obtained from shard servers
private final Map<String,Map<String,TermStats>> perShardTermStats = new
ConcurrentHashMap<>();
private final Map<String,Map<String,CollectionStats>> perShardColStats = new
ConcurrentHashMap<>();
- // global stats synchronized from the master
+ // global stats synchronized from the primary
Review comment:
same as above
##########
File path:
solr/core/src/java/org/apache/solr/handler/component/StatsValuesFactory.java
##########
@@ -182,7 +182,7 @@ protected AbstractStatsValues(StatsField statsField) {
// "NumericValueSourceStatsValues" which would have diff parent classes
//
// part of the complexity here being that the StatsValues API serves two
- // masters: collecting concrete Values from things like DocValuesStats
and
+ // primaries: collecting concrete Values from things like DocValuesStats
and
Review comment:
Interestingly, this has nothing to do with replication, no clue what
this means here
##########
File path: solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
##########
@@ -236,27 +236,27 @@ 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);
Review comment:
Missing an update here? Also, since you changed the parameter used, this
needs to handle back compatibility
##########
File path: solr/solr-ref-guide/src/replication-screen.adoc
##########
@@ -16,10 +16,10 @@
// specific language governing permissions and limitations
// under the License.
-The Replication screen shows you the current replication state for the core
you have specified. <<solrcloud.adoc#solrcloud,SolrCloud>> has supplanted much
of this functionality, but if you are still using Master-Slave index
replication, you can use this screen to:
+The Replication screen shows you the current replication state for the core
you have specified. <<solrcloud.adoc#solrcloud,SolrCloud>> has supplanted much
of this functionality, but if you are still using Primary-Secondary index
replication, you can use this screen to:
. View the replicatable index state. (on a master node)
Review comment:
missed?
##########
File path:
solr/core/src/test/org/apache/solr/cloud/cdcr/CdcrReplicationHandlerTest.java
##########
@@ -59,14 +59,14 @@ public void distribSetUp() throws Exception {
}
/**
- * Test the scenario where the slave is killed from the start. The
replication
+ * Test the scenario where the secondary is killed from the start. The
replication
Review comment:
Everything in this class is SolrCloud-related, not legacy replication
##########
File path: solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
##########
@@ -404,35 +404,35 @@ IndexFetchResult fetchLatestIndex(boolean
forceReplication, boolean forceCoreRel
}
return IndexFetchResult.LEADER_IS_NOT_ACTIVE;
}
- if (!replica.getCoreUrl().equals(masterUrl)) {
- masterUrl = replica.getCoreUrl();
- log.info("Updated masterUrl to {}", masterUrl);
+ if (!replica.getCoreUrl().equals(primaryUrl)) {
+ primaryUrl = replica.getCoreUrl();
+ log.info("Updated primaryUrl to {}", primaryUrl);
// TODO: Do we need to set forceReplication = true?
} else {
- log.debug("masterUrl didn't change");
+ log.debug("primaryUrl didn't change");
}
}
- //get the current 'replicateable' index version in the master
+ //get the current 'replicateable' index version in the primary
@SuppressWarnings({"rawtypes"})
NamedList response;
try {
response = getLatestVersion();
} 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: {}", primaryUrl, 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: {}", primaryUrl, 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);
Review comment:
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 :)
##########
File path: solr/core/src/java/org/apache/solr/handler/ReplicationHandler.java
##########
@@ -1768,13 +1770,13 @@ private static Long readIntervalNs(String interval) {
private static final String EXCEPTION = "exception";
- public static final String MASTER_URL = "masterUrl";
+ public static final String PRIMARY_URL = "primaryUrl";
public static final String FETCH_FROM_LEADER = "fetchFromLeader";
- // in case of TLOG replica, if masterVersion = zero, don't do commit
+ // in case of TLOG replica, if primaryVersion = zero, don't do commit
// otherwise updates from current tlog won't copied over properly to the new
tlog, leading to data loss
- public static final String SKIP_COMMIT_ON_MASTER_VERSION_ZERO =
"skipCommitOnMasterVersionZero";
+ public static final String SKIP_COMMIT_ON_MASTER_VERSION_ZERO =
"skipCommitOnPrimaryVersionZero";
Review comment:
Missed updating the constant name? The value on the other side is used
as a parameter between instances, we should be able to send the previous value
given a back compat mode (so that old instances can read what new instances are
sending)
##########
File path: solr/core/src/java/org/apache/solr/handler/IndexFetcher.java
##########
@@ -404,35 +404,35 @@ IndexFetchResult fetchLatestIndex(boolean
forceReplication, boolean forceCoreRel
}
return IndexFetchResult.LEADER_IS_NOT_ACTIVE;
}
- if (!replica.getCoreUrl().equals(masterUrl)) {
- masterUrl = replica.getCoreUrl();
- log.info("Updated masterUrl to {}", masterUrl);
+ if (!replica.getCoreUrl().equals(primaryUrl)) {
+ primaryUrl = replica.getCoreUrl();
+ log.info("Updated primaryUrl to {}", primaryUrl);
// TODO: Do we need to set forceReplication = true?
} else {
- log.debug("masterUrl didn't change");
+ log.debug("primaryUrl didn't change");
Review comment:
This is in the context of SolrCloud only, so it should be "leader" (that
said, that may become confusing with other lines in this code)
##########
File path:
solr/core/src/java/org/apache/solr/handler/component/FacetComponent.java
##########
@@ -1033,9 +1033,9 @@ private void refinePivotFacets(ResponseBuilder rb,
ShardRequest sreq) {
}
for (Entry<String,List<NamedList<Object>>> pivotFacetResponseFromShard :
pivotFacetResponsesFromShard) {
- PivotFacet masterPivotFacet =
fi.pivotFacets.get(pivotFacetResponseFromShard.getKey());
- masterPivotFacet.mergeResponseFromShard(shardNumber, rb,
pivotFacetResponseFromShard.getValue());
- masterPivotFacet.removeAllRefinementsForShard(shardNumber);
+ PivotFacet primaryPivotFacet =
fi.pivotFacets.get(pivotFacetResponseFromShard.getKey());
+ primaryPivotFacet.mergeResponseFromShard(shardNumber, rb,
pivotFacetResponseFromShard.getValue());
+ primaryPivotFacet.removeAllRefinementsForShard(shardNumber);
Review comment:
This has nothing to do with master/slave replication. Is this something
we want to change too? If so, I guess this is an aggregation?
##########
File path: solr/core/src/java/org/apache/solr/search/stats/LRUStatsCache.java
##########
@@ -65,7 +65,7 @@
// map of <shardName, <field, collStats>>
private final Map<String,Map<String,CollectionStats>> perShardColStats = new
ConcurrentHashMap<>();
- // global stats synchronized from the master
+ // global stats synchronized from the primary
Review comment:
same as above
##########
File path: solr/solr-ref-guide/src/collection-specific-tools.adoc
##########
@@ -24,7 +24,7 @@ In the left-hand navigation bar, you will see a pull-down
menu titled "Collectio
====
The "Collection Selector" pull-down menu is only available on Solr instances
running in <<solrcloud.adoc#solrcloud,SolrCloud mode>>.
-Single node or master/slave replication instances of Solr will not display
this menu, instead the Collection specific UI pages described in this section
will be available in the <<core-specific-tools.adoc#core-specific-tools,Core
Selector pull-down menu>>.
+Single node or primary/secondary replication instances of Solr will not
display this menu, instead the Collection specific UI pages described in this
section will be available in the
<<core-specific-tools.adoc#core-specific-tools,Core Selector pull-down menu>>.
Review comment:
same as above
##########
File path: solr/solr-ref-guide/src/distributed-search-with-index-sharding.adoc
##########
@@ -61,7 +61,7 @@ The following components support distributed search:
=== Shards Whitelist
-The nodes allowed in the `shards` parameter is configurable through the
`shardsWhitelist` property in `solr.xml`. This whitelist is automatically
configured for SolrCloud but needs explicit configuration for master/slave
mode. Read more details in the section
<<distributed-requests.adoc#configuring-the-shardhandlerfactory,Configuring the
ShardHandlerFactory>>.
+The nodes allowed in the `shards` parameter is configurable through the
`shardsWhitelist` property in `solr.xml`. This whitelist is automatically
configured for SolrCloud but needs explicit configuration for primary/secondary
mode. Read more details in the section
<<distributed-requests.adoc#configuring-the-shardhandlerfactory,Configuring the
ShardHandlerFactory>>.
Review comment:
same as above
##########
File path: solr/solr-ref-guide/src/coreadmin-api.adoc
##########
@@ -19,7 +19,7 @@
The Core Admin API is primarily used under the covers by the
<<collections-api.adoc#collections-api,Collections API>> when running a
<<solrcloud.adoc#solrcloud,SolrCloud>> cluster.
-SolrCloud users should not typically use the CoreAdmin API directly, but the
API may be useful for users of single-node or master/slave Solr installations
for core maintenance operations.
+SolrCloud users should not typically use the CoreAdmin API directly, but the
API may be useful for users of single-node or primary/secondary Solr
installations for core maintenance operations.
Review comment:
same as above
##########
File path: solr/core/src/java/org/apache/solr/search/stats/StatsCache.java
##########
@@ -176,7 +176,7 @@ public void mergeToGlobalStats(SolrQueryRequest req,
protected abstract void doMergeToGlobalStats(SolrQueryRequest req,
List<ShardResponse> responses);
/**
- * Receive global stats data from the master and update a local cache of
global stats
+ * Receive global stats data from the primary and update a local cache of
global stats
Review comment:
same as above
##########
File path: solr/solr-ref-guide/src/cloud-screens.adoc
##########
@@ -23,7 +23,7 @@ This screen provides status information about each collection
& node in your clu
.Only Visible When using SolrCloud
[NOTE]
====
-The "Cloud" menu option is only available on Solr instances running in
<<getting-started-with-solrcloud.adoc#getting-started-with-solrcloud,SolrCloud
mode>>. Single node or master/slave replication instances of Solr will not
display this option.
+The "Cloud" menu option is only available on Solr instances running in
<<getting-started-with-solrcloud.adoc#getting-started-with-solrcloud,SolrCloud
mode>>. Single node or primary/secondary replication instances of Solr will not
display this option.
Review comment:
Should we say "legacy replication" instead? (especially if we decide to
go with leader/follower)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]