Skip to content

Conversation

@jprieto-temporal
Copy link

Main Issue: #2974

Motivation

When multiple journals are configured, BookKeeper selects a journal using ledgerId % numJournals. This works well when
ledger IDs are random or sequential, but produces poor distribution when ledger IDs follow strided patterns (e.g., when
multiple clients allocate IDs from disjoint ranges). Uneven journal utilization can cause hotspots and reduce write
throughput.

Changes

  • Add journalHashBasedSelection configuration option (default: false)
  • When enabled, use Fibonacci hashing on ledger IDs before journal selection
  • The hash function multiplies by the golden ratio constant and folds high bits into low bits to break predictable
    patterns
  • Add integration test verifying read/write correctness with hash-based selection

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant