Skip to content

Increment overflow breaks K-Ordering guarantees #24

@aevitas

Description

@aevitas

The current implementation breaks the guarantee that IDs are monotonically increasing. When the increment counter overflows, the resulting ID is numerically smaller than the one generated immediately before it.

Scenario:

  • ID A is generated: (Timestamp | ... | Increment=4095).
  • ID B is generated nanoseconds later: The counter overflows, Increment=0.
  • Result: Value(ID B) < Value(ID A). This is incorrect and breaks database index performance.

#23 outlines the reason this happens.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions