[
https://issues.apache.org/jira/browse/SOLR-16690?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Patson Luk resolved SOLR-16690.
-------------------------------
Resolution: Not A Problem
Closing this as the proposed change can introduce incorrect behavior. For
example, if there's already pending changes in the ZkStateWriter, and a no op
changes invocation to enqueueUpdate can invoke the callback while the actual
pending changes are not flushed.
The existing behavior (shortcut no-op/empty ops and skip callback) is not ideal
but is technically correct, as the ZkWriteCallback#onWrite method has
description of "Called by ZkStateWriter if state is flushed to ZK", since the
empty/no-op operation does not trigger any state flush, it should not invoke
the callback neither.
> ZkStateWriter#enqueueUpdate should execute callback even tho cmds is empty or
> no-op
> -----------------------------------------------------------------------------------
>
> Key: SOLR-16690
> URL: https://issues.apache.org/jira/browse/SOLR-16690
> Project: Solr
> Issue Type: Improvement
> Components: SolrCloud
> Affects Versions: 9.1.1
> Reporter: Patson Luk
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> {{ZkStateWriter#enqueueUpdate(ClusterState prevState, List<ZkWriteCommand>
> cmds, ZkWriteCallback callback)}} accepts a callback but such callback would
> not be called if either the cmds is empty or a no-op.
> However, this could cause issues in some scenarios, for example in
> {{Overseer$ClusterStateUpdater#run}}, it calls
> clusterState = processQueueItem(message, clusterState, zkStateWriter, true,
> () -> {
> stateUpdateQueue.remove(processedNodes);
> processedNodes.clear();
> });
> Which it relies on the callback to remove items from the work queue, however
> if the message does not create an empty {{List<ZkWriteCommand>}} - for
> example "DOWNNODE" for PRS enabled collection, then the callback will be
> ignored hence the `stateUpdateQueue.remove(processedNodes);` would not be run
> even though it has finished processing the message
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]