Skip to content
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-15094: Replace all code references of coreNodeName to replicaName #2234

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

noblepaul
Copy link
Contributor

@noblepaul noblepaul commented Jan 22, 2021

This PR is just focusing on code level changes.

The actual external facing variables can be addressed separately

@@ -1714,7 +1714,7 @@ private void waitForCoreNodeName(CoreDescriptor descriptor) {

if (msgNodeName.equals(nodeName) && core.equals(msgCore)) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NULLPTR_DEREFERENCE: accessing memory that is the null pointer on line 1710 indirectly during the call to ZkNodeProps.getStr(...).

@@ -64,7 +66,7 @@ public CloudDescriptor(CoreDescriptor cd, String coreName, Properties props) {
// If no collection name is specified, we default to the core name
this.collectionName = props.getProperty(CoreDescriptor.CORE_COLLECTION, coreName);
this.roles = props.getProperty(CoreDescriptor.CORE_ROLES, null);
this.nodeName = props.getProperty(CoreDescriptor.CORE_NODE_NAME);
this.nodeName = props.getProperty(REPLICA_NAME);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we rename nodeName internally here as well? I think it's a little misleading

@@ -56,7 +56,7 @@
public static final int DEFAULT_TIMEOUT = 90;

/**
* See if coreNodeName has been taken over by another baseUrl and unload core
* See if replicaName has been taken over by another baseUrl and unload core
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update the log on line 80, and the variable name "cnn" as well

@@ -35,10 +35,10 @@
volatile String leaderSeqPath;
private SolrZkClient zkClient;

public ElectionContext(final String coreNodeName,
public ElectionContext(final String relicaName,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo :) missing p

@@ -137,7 +137,7 @@ protected RecoveryStrategy(CoreContainer cc, CoreDescriptor cd, RecoveryListener
zkController = cc.getZkController();
zkStateReader = zkController.getZkStateReader();
baseUrl = zkController.getBaseUrl();
coreZkNodeName = cd.getCloudDescriptor().getCoreNodeName();
replicaName = cd.getCloudDescriptor().getCoreNodeName();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update so we're not using deprecated method

@@ -847,7 +847,7 @@ final private void sendPrepRecoveryCmd(String leaderBaseUrl, String leaderCoreNa
WaitForState prepCmd = new WaitForState();
prepCmd.setCoreName(leaderCoreName);
prepCmd.setNodeName(zkController.getNodeName());
prepCmd.setCoreNodeName(coreZkNodeName);
prepCmd.setCoreNodeName(replicaName);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use new method

@@ -328,7 +328,7 @@ public void postSoftCommit() {
@Override
public void newSearcher(SolrIndexSearcher newSearcher, SolrIndexSearcher currentSearcher) {
if (sleepTime.get() > 0) {
TestCloudSearcherWarming.coreNodeNameRef.set(newSearcher.getCore().getCoreDescriptor().getCloudDescriptor().getCoreNodeName());
TestCloudSearcherWarming.replicaNameRef.set(newSearcher.getCore().getCoreDescriptor().getCloudDescriptor().getCoreNodeName());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use getReplicaName

@@ -187,7 +188,7 @@ private CoreDescriptor newCoreDescriptor(Replica r) {
Map<String,String> props = map(
CoreDescriptor.CORE_SHARD, r.getShard(),
CoreDescriptor.CORE_COLLECTION, r.getCollection(),
CoreDescriptor.CORE_NODE_NAME, r.getNodeName()
CommonParams.REPLICA_NAME, r.getNodeName()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r.getNodeName() should return the name of the node that the replica resides on. Use r.getName()

@@ -196,11 +201,22 @@ public void setNodeName(String nodeName) {
public String getNodeName() {
return nodeName;
}


@Deprecated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super nit: keep getters/setters together :)

@@ -887,7 +887,7 @@ public void testRetryUpdatesWhenClusterStateIsStale() throws Exception {
.process(cluster.getSolrClient()).getStatus());
cluster.waitForActiveCollection(COL, 1, 1);

// determine the coreNodeName of only current replica
// determine the replicaName of only current replica
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: rename variable on 895

@@ -880,7 +880,7 @@ public void testRetryUpdatesWhenClusterStateIsStale() throws Exception {
.process(cluster.getSolrClient()).getStatus());
cluster.waitForActiveCollection(COL, 1, 1);

// determine the coreNodeName of only current replica
// determine the replicaName of only current replica
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Rename variable on 888

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants