v2.16.0 hot fix for LogPoller pruning issue #14462
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fixes a subtle but critical bug in LogPoller's expired logs pruning which was introduced recently:
e0850a6
Changing the join from INNER to LEFT rendered the ON l.evm_chain_id=$1 ineffectual becaues ON cannot filter any rows from the left table. This could have caused the entire evm.logs table to get wiped on multichain nodes, because each LogPoller would prune all logs not matching its own chain.
Instead of ON evm_chain_id=$1 we need WHERE evm_chain_id=$1. This will ensure that each LogPoller can only delete logs from its own chain.
BCFR-906
This fix was merged separately this morning to develop as a part of a much larger PR, most of which will not go into 2.16:
e514727