#31262·scylladb

alternator: PutItem and UpdateItem omit per-table LWT shard-bounce metrics

Author: dkropachevCreated Aug 25, 2026Updated Sep 16, 2026
Labelsbugarea/alternatorai-assisted

Problem

When an LWT request is forwarded to another shard, PutItem and UpdateItem increment only the global shard_bounce_for_lwt counter. They do not increment the corresponding per-table counter. DeleteItem already increments both counters for the same event.

Current behavior

For a cross-shard PutItem or UpdateItem against table T:

scylla_alternator_shard_bounce_for_lwt               +1
scylla_alternator_table_shard_bounce_for_lwt{cf="T"} +0

For DeleteItem, both counters increase.

Expected behavior

Every regular-write LWT shard bounce should increment both global and matching per-table bounce counters.

Impact

  • Cluster-level routing overhead is visible but cannot be assigned to a table.
  • The sum of per-table bounce counters is lower than the global counter.
  • PutItem and UpdateItem appear cheaper than equivalent DeleteItem.
  • Operators cannot identify tables producing cross-shard LWT traffic.
  • Equivalent LWT events are reported inconsistently across regular write APIs.

Code references

PutItem increments only the global bounce counter:

https://github.com/scylladb/scylladb/blob/fe679915cd1c32ad56ac0f8740b44703f1722e7b/alternator/executor.cc#L3107-L3112

UpdateItem increments only the global bounce counter:

https://github.com/scylladb/scylladb/blob/fe679915cd1c32ad56ac0f8740b44703f1722e7b/alternator/executor.cc#L4393-L4398

DeleteItem increments both global and per-table counters:

https://github.com/scylladb/scylladb/blob/fe679915cd1c32ad56ac0f8740b44703f1722e7b/alternator/executor.cc#L3221-L3227