1111//!
1212//! 1. Two `document_schemaless` collections, each created `WITH
1313//! (bitemporal=true)`, are placed on DIFFERENT vShards
14- //! (`distinct_vshard_bitemporal_collections`, same technique as
15- //! `calvin_multi_shard_redo_restart.rs`).
14+ //! (`vshard_names::distinct_vshard_collections`).
1615//! 2. `BEGIN; INSERT INTO <a>; INSERT INTO <b>; COMMIT` is sent as ONE
1716//! `simple_query` call, so both writes are buffered inside the block and,
1817//! on COMMIT, `classify_dispatch` sees writes on two vShards → MultiShard.
@@ -32,9 +31,9 @@ use crate::common;
3231use std:: sync:: atomic:: Ordering ;
3332use std:: time:: Duration ;
3433
35- use nodedb:: types:: { DatabaseId , VShardId } ;
3634use tokio_postgres:: SimpleQueryMessage ;
3735
36+ use super :: vshard_names:: distinct_vshard_collections;
3837use common:: cluster_harness:: { TestClusterNode , read_once_a_leader_exists, wait_for} ;
3938
4039/// Observed sequencer-group leader id from a node's local Raft status, or `0`
@@ -61,26 +60,6 @@ fn admitted_total(node: &TestClusterNode) -> u64 {
6160 . unwrap_or ( 0 )
6261}
6362
64- /// A `(coll_a, coll_b)` pair of bitemporal collection names whose vShard ids
65- /// differ, so a transaction writing to both is genuinely multi-shard.
66- /// Deterministic: `VShardId::from_collection_in_database` is a pure function
67- /// of the database id + collection name bytes. Same technique as
68- /// `calvin_multi_shard_redo_restart.rs::distinct_vshard_collections`.
69- fn distinct_vshard_bitemporal_collections ( ) -> ( String , String ) {
70- let a_name = "bt_a" . to_string ( ) ;
71- let va = VShardId :: from_collection_in_database ( DatabaseId :: DEFAULT , & a_name) . as_u32 ( ) ;
72- for i in 0u32 ..512 {
73- let b_name = format ! ( "bt_b_{i}" ) ;
74- if VShardId :: from_collection_in_database ( DatabaseId :: DEFAULT , & b_name) . as_u32 ( ) != va {
75- return ( a_name, b_name) ;
76- }
77- }
78- panic ! (
79- "could not find a second bitemporal collection name on a distinct vShard \
80- from the first in 512 tries"
81- ) ;
82- }
83-
8463/// Current `value` for `id` in a bitemporal document collection, or `None` if
8564/// not visible.
8665///
@@ -160,7 +139,7 @@ async fn calvin_multi_shard_bitemporal_best_effort_commit_survives_wal_only_rest
160139 )
161140 . await ;
162141
163- let ( coll_a, coll_b) = distinct_vshard_bitemporal_collections ( ) ;
142+ let ( coll_a, coll_b) = distinct_vshard_collections ( "bt_a" , "bt_b" ) ;
164143
165144 node. client
166145 . simple_query ( & format ! (
0 commit comments