Skip to content

debezium/dbz#2229 feat: implement batch compaction, sync_batch, and T…#18

Open
KMohnishM wants to merge 1 commit into
gsoc-week-8-benchmarksfrom
gsoc-week-8-compaction
Open

debezium/dbz#2229 feat: implement batch compaction, sync_batch, and T…#18
KMohnishM wants to merge 1 commit into
gsoc-week-8-benchmarksfrom
gsoc-week-8-compaction

Conversation

@KMohnishM

Copy link
Copy Markdown
Contributor

…hreadPoolExecutor parallelization

Description

This PR completes the GSoC Week 8 milestone by adding batch orchestration, CDC event compaction, and concurrency to the SyncManager pipeline. It optimizes the consumption of multiple events by aggregating redundant transactions on identical primary keys and parallelizing document construction.

Proposed Changes

  • pydebeziumai.sync.manager:
    • Implemented sync_batch(self, events: list[DebeziumEventModel]) in SyncManager.
    • Implemented a CDC Compaction algorithm that groups batch events by doc_id and retains only the latest operation state (e.g., c + u + d becomes a single d event; c + u becomes a single u event). This prevents redundant updates and deletes from reaching the vector store.
    • Added ThreadPoolExecutor concurrency during the document building phase to calculate embeddings and build LangChain Documents in parallel.
    • Added a sequential fallback error-handler routine: if a batch vector operation fails, it falls back to processing events one-by-one to isolate the failure and route the specific offending event to the Dead Letter Queue (DLQ).
  • tests/unit/test_sync_manager:
    • Added test_sync_batch_compaction verifying stateful CDC event collapse behavior.
    • Added test_sync_batch_error_fallback verifying sequential fallback isolation during bulk adapter failures.

Verification Results

All 88 unit and integration tests passed successfully:

@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 5275f66 to fe6caa0 Compare July 15, 2026 04:36
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from f8eff0d to f45ab4f Compare July 15, 2026 04:36
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch 2 times, most recently from 3986f6a to f746a2f Compare July 15, 2026 04:54
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from f45ab4f to 8e32007 Compare July 15, 2026 04:55
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from f746a2f to 3c020d5 Compare July 15, 2026 05:03
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from 8e32007 to 5df9c04 Compare July 15, 2026 05:03
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 3c020d5 to 6ee0c05 Compare July 18, 2026 12:57
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from 5df9c04 to 9a57294 Compare July 18, 2026 12:57
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 6ee0c05 to d4effec Compare July 22, 2026 11:32
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from 9a57294 to 21020b8 Compare July 22, 2026 11:32
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from d4effec to 73433c9 Compare July 22, 2026 11:40
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from 21020b8 to 5da26ad Compare July 22, 2026 11:40
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 73433c9 to 55eddb4 Compare July 22, 2026 11:47
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from 5da26ad to 6acfc9f Compare July 22, 2026 11:48
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-benchmarks branch from 55eddb4 to dc59b09 Compare July 22, 2026 11:52
…hreadPoolExecutor parallelization

Signed-off-by: KMohnishM <kmohnishm@gmail.com>
@KMohnishM
KMohnishM force-pushed the gsoc-week-8-compaction branch from 6acfc9f to e8ef22a Compare July 22, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant