You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
IIUC, the root cause of the problem is because of the improper way to hack the hash() function of Serial.
Currently, we did a hack here: if there is only one column and the column type is Serial, we will use extract_vnode_id_from_row_id instead of the standard hash function.
// NOTE: here it will hash the entire row when the `_row_id` is missing,
// which could result in rows from the same chunk being allocated to different chunks.
// This process doesn’t guarantee the order of rows, producing indeterminate results in some cases,
// such as when `distinct on` is used without an `order by`.
let(row, _) = data_chunk.row_at(idx);
row.hash(Crc32FastBuilder).to_vnode(vnode_count)
}
})
.collect();
}
data_chunk
.get_hash_values(keys,Crc32FastBuilder)
.into_iter()
.map(|hash| hash.to_vnode(vnode_count))
.collect()
}
I think the best solution is to use a special distribution, e.g. RowIdDistribution instead of HashDistribution. This essentially remove the hack and make everything clear.
The problem is that, we still need to maintain compatibility with existing jobs and ensure consistent behavior. 😢 So I'm afraid the hack cannot be fully removed.
IIUC, the root cause of the problem is because of the improper way to hack the
hash()
function ofSerial
.Currently, we did a hack here: if there is only one column and the column type is
Serial
, we will useextract_vnode_id_from_row_id
instead of the standard hash function.risingwave/src/common/src/hash/consistent_hash/vnode.rs
Lines 133 to 168 in 8a32a9b
I think the best solution is to use a special distribution, e.g.
RowIdDistribution
instead ofHashDistribution
. This essentially remove the hack and make everything clear.cc. @st1page
Originally posted by @fuyufjh in #18529 (comment)
The text was updated successfully, but these errors were encountered: