Skip to content

server: release beacon block dedup mark when a sink write fails - #871

Open
damilolaedwards wants to merge 1 commit into
ethpandaops:masterfrom
damilolaedwards:fix/beacon-block-dedup-release-on-write-failure
Open

server: release beacon block dedup mark when a sink write fails#871
damilolaedwards wants to merge 1 commit into
ethpandaops:masterfrom
damilolaedwards:fix/beacon-block-dedup-release-on-write-failure

Conversation

@damilolaedwards

Copy link
Copy Markdown

Beacon block events are deduplicated by marking their state root in a shared cache during filtering. The mark was set before the events reached a sink, and it was never released if the sink write failed.

When a sink was unavailable the client retried the batch, but the retry found the mark already set and dropped the block as a duplicate. The block was therefore lost for the cache TTL despite never being durably written. Because the key is shared across sentries, every sentry reporting the same block during the outage window was dropped the same way.

This records the key marked during filtering, returns it from the handler, and releases it if any sink write fails, so a retry is processed normally. Duplicate handling on the success path is unchanged, and the only added cost is a re-processed batch on the failure path whose duplicates are absorbed by the ReplacingMergeTree tables downstream.

Scope is limited to the two event types that deduplicate against the cache via a new optional interface, so the other event handlers are untouched.

Tests: adds pipeline coverage for releasing the mark on sink failure so a retry is not dropped, plus a control confirming duplicates are still dropped after a successful write.

Beacon block events are deduplicated by marking their state root in a shared
cache during filtering. The mark was set before the events reached a sink, and
it was never released if the sink write failed. When a sink was unavailable the
client retried the batch, but the retry found the mark already set and dropped
the block as a duplicate, so it was lost for the cache TTL even though it was
never durably written.

Record the key marked during filtering, return it from the handler, and release
it if any sink write fails so a retry is processed normally. Duplicate handling
on the success path is unchanged.
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