Skip to content

Commit

Permalink
add more docs
Browse files Browse the repository at this point in the history
Signed-off-by: Bugen Zhao <[email protected]>
  • Loading branch information
BugenZhao committed Oct 18, 2024
1 parent e57d302 commit 7221dd5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
11 changes: 5 additions & 6 deletions src/frontend/src/catalog/table_catalog.rs
Original file line number Diff line number Diff line change
Expand Up @@ -174,15 +174,14 @@ pub struct TableCatalog {

/// Total vnode count of the table.
///
/// Can be unset if the catalog is generated by the frontend and not yet persisted. This is
/// Can be placeholder if the catalog is generated by the frontend and not yet persisted. This is
/// because the vnode count of each fragment (then internal tables) is determined by the
/// meta service. See also [`StreamMaterialize::derive_table_catalog`] and
/// [`TableCatalogBuilder::build`].
/// meta service. In this case, calling [`TableCatalog::vnode_count()`] will panic.
/// See also [`StreamMaterialize::derive_table_catalog`] and [`TableCatalogBuilder::build`].
///
/// On the contrary, if this comes from a [`PbTable`], the field must be `Some` no matter
/// On the contrary, if this comes from a [`PbTable`], the field must have value no matter
/// whether the table is created before or after the version we introduced variable vnode
/// count support. This is because we've already handled backward compatibility during
/// conversion.
/// count support. We will handle backward compatibility when obtaining the value.
///
/// [`StreamMaterialize::derive_table_catalog`]: crate::optimizer::plan_node::StreamMaterialize::derive_table_catalog
/// [`TableCatalogBuilder::build`]: crate::optimizer::plan_node::utils::TableCatalogBuilder::build
Expand Down
2 changes: 1 addition & 1 deletion src/meta/model_v2/src/table.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ impl From<PbTable> for ActiveModel {
let handle_pk_conflict_behavior = pb_table.handle_pk_conflict_behavior();

// `PbTable` here should be sourced from the wire, not from persistence.
// An unset `maybe_vnode_count` field should be treated as `NotSet`, instead of calling
// A placeholder `maybe_vnode_count` field should be treated as `NotSet`, instead of calling
// the compatibility code.
let vnode_count = pb_table
.vnode_count_inner()
Expand Down

0 comments on commit 7221dd5

Please sign in to comment.