Skip to content

[#2944] Batch KahaDB durable pending-ack updates on publish - #2945

Open
cshannon wants to merge 2 commits into
apache:mainfrom
cshannon:gh-2944-durable-publish
Open

cshannon wants to merge 2 commits into
apache:mainfrom
cshannon:gh-2944-durable-publish

Conversation

@cshannon

@cshannon cshannon commented Dec 4, 2026 •

Copy link
Copy Markdown
Contributor

Refs #2944. This PR covers publish batching; the single-pass isSequenceReferenced() check and restart optimization remain separate.

When a message is published to a durable topic, KahaDB now usually scans the pending acknowledgment list once and saves changes together, rather than scanning the list separately for each subscriber. It also reuses message details during publish and acknowledgment. The on-disk format is unchanged.

Durable subscribers Pending ranges Publish throughput Publish p99
8 Contiguous +44% −21%
8 Fragmented +93% −33%
32 Contiguous 4.49× −67%
32 Fragmented +62% −31%

Median of four paired JVM runs against the lookup-reuse commit. The benchmark called KahaDB directly without waiting for journal sync; it does not measure end-to-end producer throughput.

Validation: KahaDBDurableMessageRecoveryTest, KahaDBMessageStoreSizeStatTest, and KahaDBRecoverExpiredTest passed (34 tests). Six focused ListIndexTest methods passed after simplifying split tail bookkeeping, including the new interior split and missing-key regression.

Use the known journal record size during publish and reuse the order-index lookup during acknowledgment.
Traverse the pending-ack list once in steady state and store changes by node. Let the extension update the tail only when it has no successor, and cover interior splits and missing keys across reload.
@cshannon
cshannon force-pushed the gh-2944-durable-publish branch from b667565 to 1190172 Compare December 5, 2026 00:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

1 participant