• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

jallum / bedrock / 022bf889f44fabf5818028244ac5e8e953e1a798

18 Aug 2025 02:00AM UTC coverage: 62.424% (+2.5%) from 59.888%
022bf889f44fabf5818028244ac5e8e953e1a798

push

github

web-flow
Feature/31 (#35)

# Major Transaction System Overhaul

This branch represents a **fundamental rearchitecture of Bedrock's
transaction processing system** with three main
phases of development spanning performance, unification, reliability,
and architectural improvements.

  ## Phase 1: Transaction Format Unification (fd66e2d)
**Rationale**: Replace the fragmented, inconsistent transaction encoding
system with a unified, robust approach.

  **Key Changes**:
- **Consolidated Transaction Format**: Merged `read_conflicts` and
`read_version` into a single tuple format,
  eliminating redundancy
- **New BedrockTransaction Module**: Replaced the limited
`EncodedTransaction` with a comprehensive 971-line module
  featuring:
    - Tagged binary encoding with self-describing sections
    - CRC validation for data integrity
    - Order-independent sections for better extensibility
    - Efficient partial decoding capabilities
- **Removed Legacy Code**: Eliminated obsolete resolver recovery logic
and transaction fragmentation
- **Comprehensive Testing**: Added extensive test coverage including
binary integration tests

  ## Phase 2: Enhanced Transaction Processing (f96a1ed)
**Rationale**: Address reliability and robustness gaps in transaction
handling.

  **Key Improvements**:
- **Transaction Validation**: Added validation in resolver to ensure
proper transaction format before processing
- **Timeout Management**: Implemented `WaitingList` module for
systematic timeout handling across components
- **Error Resilience**: Enhanced error handling for Director
notifications and unavailable states
- **Standardization**: Moved Logger.require statements to module level
for consistency

  ## Phase 3: Commit Proxy Rework & System-Wide Improvements (dc6a048)
**Rationale**: Optimize transaction distribution and improve
observability across the data plane.

  **Major Architectural Changes**:
- **Single Transaction Per Log**: Reworked commit proxy to produce one
transaction per ... (continued)

817 of 1213 new or added lines in 110 files covered. (67.35%)

40 existing lines in 21 files now uncovered.

2369 of 3795 relevant lines covered (62.42%)

871.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

20.0
/lib/bedrock/data_plane/commit_proxy/batch.ex
1
defmodule Bedrock.DataPlane.CommitProxy.Batch do
2
  @moduledoc false
3

4
  alias Bedrock.DataPlane.Transaction
5

6
  @type reply_fn :: ({:ok, Bedrock.version()} | {:error, :abort} -> :ok)
7

8
  @type t :: %__MODULE__{
9
          started_at: Bedrock.timestamp_in_ms(),
10
          finalized_at: Bedrock.timestamp_in_ms() | nil,
11
          last_commit_version: Bedrock.version(),
12
          commit_version: Bedrock.version(),
13
          n_transactions: non_neg_integer(),
14
          buffer: [{reply_fn(), Transaction.encoded()}]
15
        }
16
  defstruct started_at: nil,
17
            finalized_at: nil,
18
            last_commit_version: nil,
19
            commit_version: nil,
20
            n_transactions: 0,
21
            buffer: []
22

23
  @spec new_batch(
24
          Bedrock.timestamp_in_ms(),
25
          last_commit_version :: Bedrock.version(),
26
          commit_version :: Bedrock.version()
27
        ) :: t()
28
  def new_batch(started_at, last_commit_version, commit_version) do
29
    %__MODULE__{
×
30
      started_at: started_at,
31
      last_commit_version: last_commit_version,
32
      commit_version: commit_version,
33
      n_transactions: 0,
34
      buffer: []
35
    }
36
  end
37

38
  @spec transactions_in_order(t()) :: [
39
          {reply_fn(), Transaction.encoded()}
40
        ]
41
  def transactions_in_order(t), do: Enum.reverse(t.buffer)
13✔
42

43
  @spec all_callers(t()) :: [reply_fn()]
NEW
44
  def all_callers(t), do: Enum.map(t.buffer, &elem(&1, 0))
×
45

46
  @spec add_transaction(t(), Transaction.encoded(), reply_fn()) :: t()
47
  def add_transaction(t, transaction, reply_fn) when is_binary(transaction),
UNCOV
48
    do: %{t | buffer: [{reply_fn, transaction} | t.buffer], n_transactions: t.n_transactions + 1}
×
49

50
  @spec set_finalized_at(t(), Bedrock.timestamp_in_ms()) :: t()
NEW
51
  def set_finalized_at(t, finalized_at), do: %{t | finalized_at: finalized_at}
×
52
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc