Skip to content

Commit

Permalink
Upgrade foca to v0.15 (#43)
Browse files Browse the repository at this point in the history
* upgrade foca

* Revert "Lint cleanup (#42)"

This reverts commit f78776b.

* Revert "Revert "Lint cleanup (#42)""

This reverts commit 0ebd45d.

* a bit more debug messages, to figure out why sync is slow

* hmm, continue instead of returning here

* remove wip sync with command
  • Loading branch information
jeromegn committed Sep 12, 2023
1 parent f78776b commit 7872cd6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ crc32fast = "1.3.2"
enquote = "1.1.0"
eyre = "0.6.8"
fallible-iterator = "0.2.0"
foca = { version = "0.12.0", features = ["std", "tracing", "bincode-codec", "serde"] }
foca = { version = "0.15.0", features = ["std", "tracing", "bincode-codec", "serde"] }
futures = "0.3.28"
futures-util = "0.3.28"
hex = "0.4.3"
Expand Down
11 changes: 9 additions & 2 deletions crates/corro-agent/src/api/peer.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::cmp;
use std::collections::HashMap;
use std::collections::{BTreeSet, HashMap};
use std::net::SocketAddr;
use std::ops::RangeInclusive;
use std::sync::Arc;
Expand Down Expand Up @@ -337,6 +337,8 @@ async fn process_range(
};

for (versions, known_version) in overlapping {
debug!("got overlapping range {versions:?} in {range:?}");

// optimization, cleared versions can't be revived... sending a single batch!
if let KnownDbVersion::Cleared = &known_version {
sender
Expand All @@ -345,9 +347,11 @@ async fn process_range(
changeset: Changeset::Empty { versions },
})))
.await?;
return Ok(());
continue;
}

let mut processed = BTreeSet::new();

for version in versions {
let bw = booked.write().await;
if let Some(known_version) = bw.get(&version) {
Expand All @@ -361,8 +365,11 @@ async fn process_range(
sender,
)
.await?;
processed.insert(version);
}
}

debug!("processed versions {processed:?}");
}

Ok(())
Expand Down

0 comments on commit 7872cd6

Please sign in to comment.