chore: fixed collab ack
This commit is contained in:
parent
0032b7e08e
commit
5d0d8cf4d1
|
|
@ -200,7 +200,7 @@ impl CollabGroup {
|
|||
sv.merge(update.state_vector);
|
||||
drop(sv);
|
||||
|
||||
let seq_num = state.seq_no.fetch_add(1, Ordering::SeqCst);
|
||||
let seq_num = state.seq_no.fetch_add(1, Ordering::SeqCst) + 1;
|
||||
tracing::trace!(
|
||||
"broadcasting collab update from {} ({} bytes) - seq_num: {}",
|
||||
update.sender,
|
||||
|
|
@ -493,7 +493,7 @@ impl CollabGroup {
|
|||
message_origin,
|
||||
state.object_id.to_string(),
|
||||
msg_id,
|
||||
state.seq_no.fetch_add(1, Ordering::SeqCst),
|
||||
state.seq_no.load(Ordering::SeqCst),
|
||||
));
|
||||
}
|
||||
|
||||
|
|
@ -547,7 +547,7 @@ impl CollabGroup {
|
|||
message_origin.clone(),
|
||||
state.object_id.to_string(),
|
||||
msg_id,
|
||||
state.seq_no.fetch_add(1, Ordering::SeqCst),
|
||||
state.seq_no.load(Ordering::SeqCst),
|
||||
)
|
||||
.with_payload(payload.unwrap_or_default()),
|
||||
);
|
||||
|
|
@ -571,7 +571,7 @@ impl CollabGroup {
|
|||
message_origin.clone(),
|
||||
state.object_id.to_string(),
|
||||
msg_id,
|
||||
state.seq_no.fetch_add(1, Ordering::SeqCst),
|
||||
state.seq_no.load(Ordering::SeqCst),
|
||||
)
|
||||
.with_code(code)
|
||||
.with_payload(payload),
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
use std::time::Duration;
|
||||
use std::time::{Duration, Instant};
|
||||
|
||||
use anyhow::Context;
|
||||
use collab::core::origin::CollabOrigin;
|
||||
|
|
@ -134,7 +134,12 @@ impl TestScenario {
|
|||
}
|
||||
|
||||
pub async fn execute(&self, collab: CollabRef) -> String {
|
||||
for t in self.txns.iter() {
|
||||
let len = self.txns.len();
|
||||
let start = Instant::now();
|
||||
for (i, t) in self.txns.iter().take(50_000).enumerate() {
|
||||
if i % 10_000 == 0 {
|
||||
tracing::trace!("step #{}/{} - {:?}", i + 1, len, start.elapsed());
|
||||
}
|
||||
let mut lock = collab.write().await;
|
||||
let collab = lock.borrow_mut();
|
||||
let mut txn = collab.context.transact_mut();
|
||||
|
|
|
|||
Loading…
Reference in New Issue