← Back to Pull requests

SOLR-17704: Back ZkDistributedLock with Curator recipes #5357

Open
unknown opened this pull request with 223 lines diff across 2 files
View on GitHub
unknown unknown commented on Nov 17, 2026 10:15 UTC
Author

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

ZkDistributedLock now wraps Curator's InterProcessReadWriteLock. 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.isAcquired is gone, and the root lock dir is now a container node.

Curator's release can throw where the old delete rarely did, so DistributedMultiLock.release now 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. DistributedMultiLockTest covers 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's LockInternals.internalLockLoop. If Curator renames that method, the tests time out instead of passing.

Diff: 223 lines (+167 / -56) across 2 files Reviewer: sarkaramrit1993 Review duration: 19475m
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
0.37
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 1 substantive comment(s)
0.02
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
46%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq
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
Assignees
Unassigned
Labels
risk: low confidence: 46.7% reviewed
Vouch Risk Breakdown
AI-powered review risk analysis
Change Risk
Change Risk · Model 1 (XGBoost)
Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
Score: 36.8% (MEDIUM) · Higher = larger blast radius
36.8%
Review Confidence
Review Confidence · Models 2 & 3
Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
Score: 46.7% · Lower = rushed or shallow review
46.7%
Residual Risk
Residual Risk · Core Equation
Residual = Change × (1 − Confidence)
Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
Score: 19.6% · Safe to merge
19.6%
Repository