-
-
Notifications
You must be signed in to change notification settings - Fork 730
runs replication leader lock expiration fix #2050
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
WalkthroughThe changes replace the leader lock acquisition retry mechanism from a fixed retry count to a time-based approach. Configuration keys, environment variables, and option interfaces are updated accordingly. The lock acquisition logic now retries until a maximum additional time elapses, with enhanced logging. A new integration test verifies leadership handover and lock extension. Additional improvements include enhanced logging, tracing spans, and HTTP connection keep-alive configuration for the ClickHouse client. Changes
Sequence Diagram(s)sequenceDiagram
participant ServiceA as RunsReplicationService A
participant ServiceB as RunsReplicationService B
participant Redis as Redis (Redlock)
participant ClickHouse as ClickHouse
participant Postgres as Postgres
ServiceA->>Redis: Attempt to acquire leader lock (with timeout + additional time)
Redis-->>ServiceA: Lock acquired
ServiceA->>Postgres: Read new TaskRun
ServiceA->>ClickHouse: Replicate TaskRun data
Note over ServiceA: ServiceA running as leader
ServiceB->>Redis: Attempt to acquire leader lock (while ServiceA is leader)
Redis-->>ServiceB: Lock denied (retries until ServiceA stops)
ServiceA-->>Redis: Release leader lock (ServiceA stops)
ServiceB->>Redis: Acquire leader lock (succeeds after retries)
Redis-->>ServiceB: Lock acquired
ServiceB->>Postgres: Read new TaskRun
ServiceB->>ClickHouse: Replicate TaskRun data
Note over ServiceB: ServiceB now running as leader
Possibly related PRs
Poem
Tip ⚡️ Faster reviews with caching
Enjoy the performance boost—your workflow just got faster. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (6)
✅ Files skipped from review due to trivial changes (1)
🚧 Files skipped from review as they are similar to previous changes (2)
🧰 Additional context used🧬 Code Graph Analysis (1)internal-packages/clickhouse/src/index.ts (1)
⏰ Context from checks skipped due to timeout of 90000ms (7)
🔇 Additional comments (20)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
…_MAX_OLD_SPACE_SIZE
Summary by CodeRabbit
New Features
Bug Fixes
Refactor