Skip to content

internal/compact: DeletableValueMerger needDelete path corrupts iterator state #6168

Description

@ostafen

Summary

When a merger implementing base.DeletableValueMerger returns delete=true from DeletableFinish during a compaction, the compaction iterator's needDelete handling elides the merge result via continue without performing the skip/position bookkeeping that the normal returned-key path performs. Depending on arrangement this causes either:

  • Silent data corruption: the just-consumed base SET (and any older same-key entries the pending skip was supposed to elide) are re-processed as fresh keys, resurrecting a value for a key the merger declared non-existent; or
  • A panic: compaction iterator has skip=true, but iterator is at iterPosNext on a subsequent Iter.Next() call.

Reproduced on v2.1.4, v2.1.5, v2.1.6; the relevant code is unchanged on master.

Jira issue: PEBBLE-1469

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions