Skip to content

fix!: report unreadable tables as read failures - #17

Merged
xRookieFight merged 3 commits into
vlang:masterfrom
bedrock-v:fix/propagate-read-failures
Sep 29, 2026
Merged

xRookieFight merged 3 commits into
vlang:masterfrom
bedrock-v:fix/propagate-read-failures

Conversation

@nepinhum

@nepinhum nepinhum commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Closes #16

Changes

  • TableReader.get() returns !TableHit (found / value / kt) and
    propagates decode_block_handle, read_block (checksum and decompression),
    decode_block and parse_internal_key. The index search is split into
    block_index(), which cannot fail and block_handle(), which reports an index entry
    that will not decode.
  • DB.get() returns !Lookup (found / value), DB.has() returns !bool
    and both db.table(f.num) or { continue } sites propagate.
  • A Bloom filter rejection and a block search that finds no matching key stay
    plain absence.

The finding suggests !?[]u8. V has no !?T, so presence rides inside the result as Lookup.found.
Same three outcomes: found, not found, read failure.

Breaking

// before
if value := db.get(key, leveldb.ReadOptions{}) {
      println(value.bytestr())
}

// after
r := db.get(key, leveldb.ReadOptions{})!
if r.found {
      println(r.value.bytestr())
}

CHANGELOG.md carries the same note.

Tests

  • v test . [passed]
  • v run examples/smoke/main.v

@nepinhum
nepinhum marked this pull request as draft September 28, 2026 21:15
@nepinhum
nepinhum marked this pull request as ready for review September 28, 2026 21:17
@nepinhum

Copy link
Copy Markdown
Contributor Author

@xRookieFight can you review?

@nepinhum

Copy link
Copy Markdown
Contributor Author

windows ci fails with:
image

& macos tests passed the checks

@xRookieFight

Copy link
Copy Markdown
Collaborator

windows ci fails with: image

& macos tests passed the checks

@medvednikov

@xRookieFight
xRookieFight merged commit 807b48a into vlang:master Sep 29, 2026
2 of 4 checks passed
@xRookieFight
xRookieFight deleted the fix/propagate-read-failures branch September 29, 2026 13:46
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.

Propagate table read failures instead of reporting "not found"

2 participants