SOLR-17704: Back ZkDistributedLock with Curator recipes #5357
All Vouch review confidence checks passed
Residual risk 0.20 = Change Risk (0.37) × (1 − Review Confidence (0.47)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 223 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.324
Real PR Conversation Timeline
1 comments
"Review active on #5357"
general
weight: 0.35
sarkaramrit1993
https://issues.apache.org/jira/browse/SOLR-17704
Description
Upgrade impact: with the Overseer disabled, 10.x and 11 nodes don't see each other's API locks, so upgrading needs a full restart or paused Collection and ConfigSet API commands. See "Rolling Upgrades" in the 11 upgrade notes.
Solr carries its own ZooKeeper read/write lock. Curator already ships a well-used one, so this swaps it in. The same lock serves the Collection API and the ConfigSet API.
Solution
ZkDistributedLocknow wraps Curator'sInterProcessReadWriteLock. Nodes get created per level when the lock is acquired. The fixed order (collection, shard, replica) still prevents deadlock. Acquire and release must happen on one thread.DistributedLock.isAcquiredis gone, and the root lock dir is now a container node.Curator's release can throw where the old delete rarely did, so
DistributedMultiLock.releasenow releases every lock and rethrows the first failure, and the ConfigSet runner logs a release failure instead of letting it hide the command's own error.SOLR-18668 follows up by refusing these commands while an older major version node is live. SOLR-18669 tracks a ConfigSet CREATE lock-order deadlock that predates this change.
Tests
Lock tests run without
isAcquired, plus new ones for lazy levels and interrupted waiters.DistributedMultiLockTestcovers a release that fails part way. Curator cleans up after an interrupt asynchronously, so those tests poll. To check a lock is really blocked, the test helper waits until the acquiring thread parks in Curator'sLockInternals.internalLockLoop. If Curator renames that method, the tests time out instead of passing.