From 8cebf7848522a8928ac88b9cd7d7595103d1bdaa Mon Sep 17 00:00:00 2001 From: Kerollmops Date: Tue, 26 May 2020 17:03:53 +0200 Subject: [PATCH] Bump heed to 0.8.0 and handle abort errors --- Cargo.lock | 4 ++-- meilisearch-core/Cargo.toml | 2 +- meilisearch-core/src/database.rs | 6 +++--- meilisearch-http/Cargo.toml | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf36e31cf..a2b38b19a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1234,9 +1234,9 @@ dependencies = [ [[package]] name = "heed" -version = "0.7.1" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d432af60d4dada5bc2d391b98ed258a16e659a4b5ec88b0c90e148062ed1a5c" +checksum = "fd7882b766b4be1b90d8ce5ce4c7aca2539b43176a708dbc8e79576dbbdbba93" dependencies = [ "byteorder", "heed-traits", diff --git a/meilisearch-core/Cargo.toml b/meilisearch-core/Cargo.toml index b8aa2600d..912210007 100644 --- a/meilisearch-core/Cargo.toml +++ b/meilisearch-core/Cargo.toml @@ -18,7 +18,7 @@ either = "1.5.3" env_logger = "0.7.1" fst = "0.4.4" hashbrown = { version = "0.7.1", features = ["serde"] } -heed = "0.7.0" +heed = "0.8.0" indexmap = { version = "1.3.2", features = ["serde-1"] } intervaltree = "0.2.5" itertools = "0.9.0" diff --git a/meilisearch-core/src/database.rs b/meilisearch-core/src/database.rs index 5672c3c1e..ffd3b7cb3 100644 --- a/meilisearch-core/src/database.rs +++ b/meilisearch-core/src/database.rs @@ -104,7 +104,7 @@ fn update_awaiter( }; // do not keep the reader for too long - update_reader.abort(); + break_try!(update_reader.abort(), "aborting update transaction failed"); // instantiate a transaction to touch to the main env let result = env.typed_write_txn::(); @@ -118,7 +118,7 @@ fn update_awaiter( if status.error.is_none() { break_try!(main_writer.commit(), "commit nested transaction failed"); } else { - main_writer.abort() + break_try!(main_writer.abort(), "abborting nested transaction failed"); } // now that the update has been processed we can instantiate @@ -178,7 +178,7 @@ impl Database { must_open.push(index_uid.to_owned()); } - reader.abort(); + reader.abort()?; // open the previously aggregated indexes let mut indexes = HashMap::new(); diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index c1a5a7f22..368c8f649 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -29,7 +29,7 @@ chrono = { version = "0.4.11", features = ["serde"] } crossbeam-channel = "0.4.2" env_logger = "0.7.1" futures = "0.3.4" -heed = "0.7.0" +heed = "0.8.0" http = "0.1.19" indexmap = { version = "1.3.2", features = ["serde-1"] } log = "0.4.8"