Bedrock.DataPlane.CommitProxy.ConflictSharding (bedrock v0.6.0)

View Source

Shards transaction conflicts across resolvers by key range.

Takes transaction conflict sections and creates resolver-specific transaction binaries containing only conflicts within each resolver's key range.

Process

  1. Extract read/write conflicts from transaction sections
  2. Distribute conflict ranges across resolvers using sweep algorithm
  3. Split ranges that span multiple resolver boundaries
  4. Build Transaction-format binaries for each resolver

Usage

sharded_transactions = ConflictSharding.shard_conflicts_across_resolvers(
  transaction_sections,
  resolver_ends,  # [{end_key, resolver_pid}]
  resolver_refs   # [resolver_pid]
)
# Returns %{resolver_pid => transaction_binary}

Summary

Functions

shard_conflicts_across_resolvers(sections, resolver_ends, resolver_refs)

@spec shard_conflicts_across_resolvers(binary(), [{binary(), pid()}], [pid()]) :: %{
  required(pid()) => binary()
}