Skip to content

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

String msgNodeName = getNodeName();
String msgCore = descriptor.getName();

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(...).

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


/**
* 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

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

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

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

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

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()

}


@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 :)

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

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