Skip to content

chore: Bump ver: 0.5.0#9

Merged
drmingdrmer merged 2 commits into
databendlabs:mainfrom
drmingdrmer:main
Jul 19, 2026
Merged

chore: Bump ver: 0.5.0#9
drmingdrmer merged 2 commits into
databendlabs:mainfrom
drmingdrmer:main

Conversation

@drmingdrmer

Copy link
Copy Markdown
Member

Changelog

chore: Bump ver: 0.5.0
refactor: remove multi-namespace support from mvcc

Summary

The mvcc module's read/write/range API collapses from a
namespace-scoped, per-call sequence-bounded trait zoo into a
single-space view API: every Table, Snapshot, and View now
owns exactly one key-value space, and View itself implements the
resulting ViewApi trait directly.

Details

Removed the entire scoped_*/seq_bounded_* trait family
(ScopedApi, ScopedGet, ScopedRange, ScopedRead, ScopedSet,
ScopedSeqBoundedGet, ScopedSeqBoundedIntoRange,
ScopedSeqBoundedRange, ScopedSeqBoundedRangeIter, SeqBoundedGet,
SeqBoundedIntoRange, SeqBoundedRange, SeqBoundedRangeIter)
along with ViewNamespace, ViewKey, ViewValue, and the Commit
trait. Table's own lookups already covered the point/multi-key/range
cases, and key/value bounds now come from the crate's existing
MapKey/MapValue traits, so this whole parallel hierarchy was
redundant. The survivors are renamed into the view_* family, and a
new ReadAtSeq trait (read_at_seq.rs) provides the one remaining
per-call sequence-bounded read (get_at_seq/range_at_seq).

With ViewNamespace gone, Table, Snapshot, and View drop their
namespace type parameter (<S, K, V> becomes <K> / <K, D>).
Tables<K> is now a plain Table<K, V> instead of
BTreeMap<S, Table<K, V>>, so every method loses its space
argument.

  • The per-namespace increments_seq() flag is replaced by a
    per-View with_tombstone_seq_increment() setting plus explicit
    set_without_seq_increment / fetch_and_set_without_seq_increment
    calls for callers that need the old opt-out behavior.
  • Snapshot::commit() is gone. View::into_parts() now returns
    (reader, last_seq, changes) so callers merge with
    Table::merge() instead of going through a namespace-aware commit
    trait.
  • View<K, D> now implements ViewRead, ViewWrite, and
    ViewRange directly, delegating to its own methods, so it
    satisfies the combined ViewApi bound — a compile-time assertion
    test guards that.
  • Dropped namespace_view_no_seq_increase_test.rs, which only
    exercised the now-removed per-namespace increments_seq()
    behavior.

  • Improvement

@drmingdrmer
drmingdrmer force-pushed the main branch 7 times, most recently from 83b35da to 2c92d93 Compare July 19, 2026 12:43
# Summary

The mvcc module's read/write/range API collapses from a
namespace-scoped, per-call sequence-bounded trait zoo into a
single-space view API: every `Table`, `Snapshot`, and `View` now
owns exactly one key-value space, reads/writes/ranges are split into
focused single-purpose traits that compose into `ViewApi`, and
`View` itself implements that trait directly.

# Details

Removed the entire `scoped_*`/`seq_bounded_*` trait family
(`ScopedApi`, `ScopedGet`, `ScopedRange`, `ScopedRead`, `ScopedSet`,
`ScopedSeqBoundedGet`, `ScopedSeqBoundedIntoRange`,
`ScopedSeqBoundedRange`, `ScopedSeqBoundedRangeIter`, `SeqBoundedGet`,
`SeqBoundedIntoRange`, `SeqBoundedRange`, `SeqBoundedRangeIter`)
along with `ViewNamespace`, `ViewKey`, `ViewValue`, and the `Commit`
trait. `Table`'s own lookups already covered the point/multi-key/range
cases, and key/value bounds now come from the crate's existing
`MapKey`/`MapValue` traits, so this whole parallel hierarchy was
redundant.

In its place, `read_at_seq.rs` provides `GetAtSeq`/`RangeAtSeq` for
per-call sequence-bounded reads, and `view_get.rs`/`view_set.rs`/
`view_range.rs` provide `ViewGet`/`ViewSet`/`ViewRange` for a view
that owns its own sequence boundary. `ViewSet<K>: ViewGet<K>` is a
supertrait, so its default `fetch_and_set()` gets `get()`/`set()` for
free instead of every implementor rewriting it. `ViewApi<K>` is a
blanket trait over all three, and `View<K, D>` now implements them
directly instead of only exposing equivalent inherent methods.

With `ViewNamespace` gone, `Table`, `Snapshot`, and `View` drop their
namespace type parameter (`<S, K, V>` becomes `<K>` / `<K, D>`), and
the public `Tables`/`TablesSnapshot` type aliases that named the old
`BTreeMap<S, Table<K, V>>` composition are gone too — every method
loses its `space` argument.

- The per-namespace `increments_seq()` flag is replaced by a
  per-`View` `with_tombstone_seq_increment()` setting plus explicit
  `set_without_seq_increment` / `fetch_and_set_without_seq_increment`
  calls for callers that need the old opt-out behavior.
- `Snapshot::commit()` is gone. `View::into_parts()` now returns
  `(reader, last_seq, changes)` so callers merge with
  `Table::merge()` instead of going through a namespace-aware commit
  trait.
- Dropped `namespace_view_no_seq_increase_test.rs`, which only
  exercised the now-removed per-namespace `increments_seq()`
  behavior.

@xp-trumpet xp-trumpet left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@xp-trumpet partially reviewed 31 files and all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on drmingdrmer).

@drmingdrmer
drmingdrmer merged commit 556bde7 into databendlabs:main Jul 19, 2026
1 check passed
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