multi: Add decayedlog db migration code

This commit adds the migration code for the decayedlog db which
is optional and will default to true.
This commit is contained in:
ziggie
2025-06-17 20:42:09 +02:00
parent c7e773132b
commit d220b87b60
7 changed files with 62 additions and 5 deletions

View File

@@ -498,6 +498,7 @@ func TestOptionalMeta(t *testing.T) {
om = &OptionalMeta{
Versions: map[uint64]string{
0: optionalVersions[0].name,
1: optionalVersions[1].name,
},
}
err = db.putOptionalMeta(om)
@@ -506,7 +507,10 @@ func TestOptionalMeta(t *testing.T) {
om1, err := db.fetchOptionalMeta()
require.NoError(t, err, "error getting optional meta")
require.Equal(t, om, om1, "unexpected empty versions")
require.Equal(t, "0: prune_revocation_log", om.String())
require.Equal(
t, "0: prune_revocation_log, 1: gc_decayed_log",
om1.String(),
)
}
// TestApplyOptionalVersions checks that the optional migration is applied as
@@ -565,6 +569,7 @@ func TestApplyOptionalVersions(t *testing.T) {
omExpected := &OptionalMeta{
Versions: map[uint64]string{
0: optionalVersions[0].name,
1: optionalVersions[1].name,
},
}
require.Equal(t, omExpected, om, "unexpected empty versions")