Skip to content

TBS: potential data loss in race condition between event arrival and receiving decision #17772

@carsonip

Description

@carsonip

As TBS pebble implementation does not use db transaction and there are no locks, theoretically it is possible for the following sequence of events to happen.

  1. goroutine A: a trace event T belonging to trace id 123 to arrive
  2. goroutine A: confirm that no decision is made for trace id 123
  3. goroutine B: make a sampling decision for trace id 123
  4. goroutine B: publish all events for trace id 123
  5. goroutine A: write trace event T to pebble
  6. trace event T will sit in pebble until being deleted at TTL

Confirm if this is possible by adding a unit test, and if so, add a fix and measure the perf hit.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions