Skip to content

Make leader-election lease renewal safe across clock jumps #1295

Description

@Jagadeeshftw

Area: Indexer / distributed reliability

Problem

src/indexer/leaderElection.ts coordinates ownership and lease renewal; wall-clock jumps can create false ownership or premature expiry.

Design decision required

Choose monotonic time/DB time and define renewal behavior after a clock anomaly.

Deliverable

Simulate forward/backward jumps, delayed renewal, and restart and assert no split-brain write permission.

Acceptance criteria

  • The selected behavior is implemented and covered by focused regression tests.
  • Failure, boundary, retry, and authorization behavior is explicit where applicable.
  • Existing behavior outside this scope remains unchanged.
  • CI output and any performance/resource impact are reported in the PR.

Out of scope

  • Typo-only, documentation-only, unrelated refactors, and dependency churn.
  • Closing, weakening, or skipping tests to make the change pass.

Verification

pnpm vitest run tests/indexer/leaderElection.test.ts

PR requirements

  • Keep the PR focused, explain the before/after behavior, and reference this issue.
  • Include the requested regression evidence and relevant CI results.
  • Open the PR within 48 hours of assignment or leave a scope question on the issue.
  • Contributor discussion: https://t.me/+u5qmu35nZ7I0OTU1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions