scylladb / scylladb/cpp-rs-driver

Avoid busy-spinning when time UUID timestamp capacity is exhausted

Open
#507 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
C++
Stars
26
Forks
19
Avg merge
1d 21h
Merged PRs (30d)
7

Description

Problem

cass_uuid_gen_time() can allocate 10,000 unique 100-nanosecond timestamps per millisecond. Once a shared generator exhausts this capacity, callers busy-spin until the wall clock advances. Workloads above roughly 10 million UUIDs per second can therefore consume CPU and incur latency.

Options

  • Yield: preserve timestamp behavior and let other threads run, but potentially reduce peak throughput and still use substantial CPU.
  • Advance the timestamp: remove the limit and spinning with a simple implementation, but allow generated timestamps to move ahead of wall time and diverge from the legacy driver.
  • Sleep: preserve timestamp behavior and reduce CPU use, but risk scheduler oversleep, extra latency, and lower throughput.
  • Keep current behavior: retain legacy compatibility and current benchmark results, but keep busy-spinning above the limit.

Benchmark single- and multi-threaded workloads, select an approach, and update implementation, tests, and documentation.

Related: #506.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the cass_uuid_gen_time() entry point and run the single- and multi-threaded workloads requested in the issue to compare yielding, advancing the timestamp, sleeping, and the current behavior. Done means one approach is selected from the benchmark results, with the implementation, tests, and documentation updated accordingly.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, rust
Domain
performance
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Active
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.