Skip to content

Commit

Permalink
internal/keyspan: fix InterleavingIter error handling
Browse files Browse the repository at this point in the history
Previously, the InterleavingIter could violate the InternalIterator contract
when an error is encountered. If one of its two child iterators encountered an
error and returned a nil KV pair, the iterator could yield a non-nil KV to the
caller. This commit updates the interleaving iterator error handling to
accumulate any encountered errors on a field and always yield nil.

This bug was surfaced by a new 'invariants' tag assertion in Valid, asserting
that Error() returns nil if the iterator is valid. With this invariants tag,
existing tests surface the assertion failure. Additional test coverage will
come with #1115.
  • Loading branch information
jbowens committed Oct 30, 2023
1 parent b9263c9 commit 33a77e1
Show file tree
Hide file tree
Showing 2 changed files with 109 additions and 65 deletions.
Loading

0 comments on commit 33a77e1

Please sign in to comment.