Skip to content

Commit

Permalink
get_row does not include vnode
Browse files Browse the repository at this point in the history
  • Loading branch information
kwannoel committed Sep 20, 2023
1 parent 1416f60 commit 55e4f5a
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/stream/src/executor/backfill/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -309,9 +309,11 @@ pub(crate) async fn get_progress_per_vnode<S: StateStore, const IS_REPLICATED: b
}

pub(crate) fn get_backfill_finished(row: OwnedRow, state_len: usize) -> Option<bool> {
let datum = if row.len() < state_len {
let datum = if row.len() == state_len - 2 {
// Handle backwards compatibility case where
// we did not have row count.
// we did not have row count (-1 for this).
// StateTable::get_row does not include vnode as well,
// so we -1 for it.
row.last()
} else {
row.datum_at(row.len() - 2)
Expand All @@ -320,7 +322,11 @@ pub(crate) fn get_backfill_finished(row: OwnedRow, state_len: usize) -> Option<b
}

pub(crate) fn get_row_count(row: OwnedRow, state_len: usize) -> u64 {
if row.len() < state_len {
if row.len() == state_len - 2 {
// Handle backwards compatibility case where
// we did not have row count (-1 for this).
// StateTable::get_row does not include vnode as well,
// so we -1 for it.
return 0;
}
match row.last() {
Expand Down

0 comments on commit 55e4f5a

Please sign in to comment.