Skip to content

Fix retention term - #453

Open
yacovm wants to merge 2 commits into
mainfrom
fixRetentionTerm
Open

Fix retention term#453
yacovm wants to merge 2 commits into
mainfrom
fixRetentionTerm

Conversation

@yacovm

@yacovm yacovm commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

When a finalization is written to the WAL, the garbage collecting WAL invokes RetentionTerm()
as part of its Append() operation.
However, the current implementation returned an error in case it was a finalization.

This commit fixes this by adding the finalization option to the RetentionTerm function.

@yacovm
yacovm marked this pull request as draft July 22, 2026 23:12
@yacovm
yacovm force-pushed the fixRetentionTerm branch from c10278c to 1e5dac9 Compare July 23, 2026 13:56
@yacovm
yacovm marked this pull request as ready for review July 23, 2026 14:19
When a finalization is written to the WAL, the garbage collecting WAL invokes RetentionTerm()
as part of its Append() operation.
However, the current implementation returned an error in case it was a finalization.

This commit fixes this by adding the finalization option to the RetentionTerm function.

Signed-off-by: Yacov Manevich <yacov.manevich@avalabs.org>
@yacovm
yacovm force-pushed the fixRetentionTerm branch from 1e5dac9 to 69bc1df Compare July 28, 2026 15:05
Comment thread common/encoding.go
switch recordType {
case BlockRecordType:
return BlockRecordRetentionTerm(entry)
case NotarizationRecordType:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why dont we just have one branch for all QuorumRecordRetentionTerm(entry) calls?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment thread instance_test.go
type noopComm struct{}

func (noopComm) Broadcast(*common.Message) {}
func (noopComm) Send(*common.Message, common.NodeID) {}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think we have testuitl.NoopComm already

Comment thread instance_test.go
func (noopComm) Broadcast(*common.Message) {}
func (noopComm) Send(*common.Message, common.NodeID) {}

func TestInstanceOutOfOrderFinalizationPersistedToWAL(t *testing.T) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aren't we just testing the garbage collection WAL? Can't we replicate this behavior in a more simple manner without the instance?

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.

2 participants