Skip to content

Commit

Permalink
refactor(iroh, iroh-blobs, iroh-net)!: remove deprecated items (#2652)
Browse files Browse the repository at this point in the history
## Description

Removes items deprecated in the last release.

## Breaking Changes

### iroh-blobs
- `iroh_blobs::store::fs::Store::import_flat_store` was previously
deprecated and is now removed. Use iroh <= `0.22.0` to migrate.
- `iroh_blobs::store::fs::FlatStorePaths` is removed. This was only used
for importing flat stores, which were previously deprecated. Use iroh <=
`0.22.0` to migrate.

### iroh
- Automatic migration from flat stores is no longer possible. This was
previously deprecated. Use iroh <= `0.22.0` to migrate.

### iroh-net
- `iroh_net::endpoint::RemoteInfo::last_alive_relay` was previously
deprecated and it's now removed.

## Notes & open questions

n/a

## Change checklist

- [x] Self-review.
- [ ] ~~Documentation updates following the [style
guide](https://rust-lang.github.io/rfcs/1574-more-api-documentation-conventions.html#appendix-a-full-conventions-text),
if relevant.~~
- [x] Tests if relevant.
- [x] All breaking changes documented.
  • Loading branch information
divagant-martian authored Aug 20, 2024
1 parent 855e1bb commit 060bf83
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 566 deletions.
41 changes: 1 addition & 40 deletions iroh-blobs/src/store/fs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ use smallvec::SmallVec;
use tokio::io::AsyncWriteExt;
use tracing::trace_span;

mod import_flat_store;
mod migrate_redb_v1_v2;
mod tables;
#[doc(hidden)]
Expand Down Expand Up @@ -586,11 +585,6 @@ pub(crate) enum ActorMessage {
cmd: Export,
tx: oneshot::Sender<ActorResult<()>>,
},
/// Modification method: import an entire flat store into the redb store.
ImportFlatStore {
paths: FlatStorePaths,
tx: oneshot::Sender<bool>,
},
/// Update inline options
UpdateInlineOptions {
/// The new inline options
Expand Down Expand Up @@ -680,8 +674,7 @@ impl ActorMessage {
Self::UpdateInlineOptions { .. }
| Self::Sync { .. }
| Self::Shutdown { .. }
| Self::Fsck { .. }
| Self::ImportFlatStore { .. } => MessageCategory::TopLevel,
| Self::Fsck { .. } => MessageCategory::TopLevel,
#[cfg(test)]
Self::EntryState { .. } => MessageCategory::ReadOnly,
}
Expand All @@ -698,17 +691,6 @@ enum MessageCategory {
pub(crate) type FilterPredicate<K, V> =
Box<dyn Fn(u64, AccessGuard<K>, AccessGuard<V>) -> Option<(K, V)> + Send + Sync>;

/// Parameters for importing from a flat store
#[derive(Debug)]
pub struct FlatStorePaths {
/// Complete data files
pub complete: PathBuf,
/// Partial data files
pub partial: PathBuf,
/// Metadata files such as the tags table
pub meta: PathBuf,
}

/// Storage that is using a redb database for small files and files for
/// large files.
#[derive(Debug, Clone)]
Expand Down Expand Up @@ -756,15 +738,6 @@ impl Store {
pub async fn dump(&self) -> io::Result<()> {
Ok(self.0.dump().await?)
}

/// Import from a v0 or v1 flat store, for backwards compatibility.
#[deprecated(
since = "0.23.0",
note = "Flat stores are deprecated and future versions will not be able to migrate."
)]
pub async fn import_flat_store(&self, paths: FlatStorePaths) -> io::Result<bool> {
Ok(self.0.import_flat_store(paths).await?)
}
}

#[derive(Debug)]
Expand Down Expand Up @@ -1001,14 +974,6 @@ impl StoreInner {
Ok(rx.await??)
}

async fn import_flat_store(&self, paths: FlatStorePaths) -> OuterResult<bool> {
let (tx, rx) = oneshot::channel();
self.tx
.send(ActorMessage::ImportFlatStore { paths, tx })
.await?;
Ok(rx.await?)
}

async fn update_inline_options(
&self,
inline_options: InlineOptions,
Expand Down Expand Up @@ -2193,10 +2158,6 @@ impl ActorState {

fn handle_toplevel(&mut self, db: &redb::Database, msg: ActorMessage) -> ActorResult<()> {
match msg {
ActorMessage::ImportFlatStore { paths, tx } => {
let res = self.import_flat_store(db, paths);
tx.send(res?).ok();
}
ActorMessage::UpdateInlineOptions {
inline_options,
reapply,
Expand Down
Loading

0 comments on commit 060bf83

Please sign in to comment.