1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// SPDX-License-Identifier: BUSL-1.1
//! Feeds the Calvin scheduler's [`HotKeyTable`](crate::control::cluster::calvin::scheduler::lock::HotKeyTable)
//! from every COMMIT abort path.
//!
//! A key a transaction read and then aborted on is a candidate hot key: enough
//! repeat aborts within the rolling window promote it to "hot" so a later read
//! reserves it up front instead of contending at commit time. This module only
//! ACCUMULATES the stat — it never reads [`HotKeyTable::is_hot`] and never
//! feeds any replicated decision.
use crateLockKey;
use crateSharedState;
use ;
/// Record every point-key read by an aborting txn against the hot-key table so
/// repeated conflicts on the same key promote it to "hot".
pub
/// Map a read-set entry to the deterministic lock key it observed, when the
/// read was a single-row point read (`Surrogate` or `KvKey`). Every other
/// `ReadKey` shape (predicate / index-eq / index-range scans, and the graph
/// `Edge` identity, which has no `LockKey` counterpart carrying string node
/// ids rather than surrogates) is a coarse or non-point observation with no
/// single lock key to charge the abort against.
///
/// Delegates to [`lock_key_of_read`], the same construction the reserve-at-read
/// path uses, so the `KeyRepr` match lives in exactly one place.