SOLR-17269: Do not publish synthetic solr core (of Coordinator node) to ZK #2438
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
https://issues.apache.org/jira/browse/SOLR-17269
Description
The synthetic collection/replica introduced in Solr 9 registers such collection to zookeeper. This might cause issues with other tools which monitor solr collections via zk and they might be mistaken the synthetic collection as a real collection.
Solution
We are introducing a new class
SyntheticSolrCore
which extendsSolrCore
,SyntheticSolrCore
is only used in Coordinator node to support a subset ofSolrCore
functionalities required by Coordinator operations such as aggregating and writing out response and providing configset info. There will be one instance ofSyntheticSolrCore
per config set.Such synthetic core is only registered to the
CoreContainer
but is no longer registering itself to zookeeper.Take note that to minimize code changes, there will still be snapshot/index data directory written to the Coordinator node. We could have overridden
initSnapshotMetaDataManager
andinitIndex
to be no-op to avoid creating them, however, there is currently other code (and possibly future code too) that might rely on the existence of those fields. It is safer to just keep them as is.The data folder for the synthetic core would NOT be loaded on QA node start-up as there's no
core.properties
in such directory. This is because instead of going throughCoreContainer#create
for such synthetic core, it's usingSyntheticSolrCore#createAndRegisterCore
, which bypasscore.properties
creation and zk registrationTests
The existing
TestCoordinatorRole
has already provided good coverage of various scenarios. Take note that we have removed the test code that verifies the existence of cores from the synthetic collection since zk no longer keeps track of synthetic collections. Instead we added a check inTestCoordinatorRole#testSimple
to ensure that the synthetic collection no longer exists in cluster state.Checklist
Please review the following and check all that apply:
main
branch../gradlew check
.