From a8b3c8fd5898400d64310f61bb1a41dd5fefe5ea Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Fri, 20 Nov 2020 23:37:34 +0100 Subject: data hexdump in warning --- Cargo.lock | 39 +++++++++++++++++++++++++++++++++++++++ src/table/Cargo.toml | 1 + src/table/table.rs | 3 +++ 3 files changed, 43 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index 6382d035..330b50fc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -15,6 +15,16 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" +[[package]] +name = "arrayvec" +version = "0.3.25" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06f59fe10306bb78facd90d28c2038ad23ffaaefa85bac43c8a434cde383334f" +dependencies = [ + "nodrop", + "odds", +] + [[package]] name = "async-trait" version = "0.1.36" @@ -588,6 +598,7 @@ dependencies = [ "garage_rpc 0.1.0", "garage_util 0.1.0", "hex", + "hexdump", "log", "rand", "rmp-serde", @@ -743,6 +754,16 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +[[package]] +name = "hexdump" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "850f3f2c33d20c0f96c4485e087dd580ff041d720988ebf4c84a42acf739262b" +dependencies = [ + "arrayvec", + "itertools", +] + [[package]] name = "hmac" version = "0.7.1" @@ -870,6 +891,12 @@ dependencies = [ "libc", ] +[[package]] +name = "itertools" +version = "0.4.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f" + [[package]] name = "itoa" version = "0.4.6" @@ -1027,6 +1054,12 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "nodrop" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72ef4a56884ca558e5ddb05a1d1e7e1bfd9a68d9ed024c21704cc98872dae1bb" + [[package]] name = "num-integer" version = "0.1.43" @@ -1056,6 +1089,12 @@ dependencies = [ "libc", ] +[[package]] +name = "odds" +version = "0.2.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4eae0151b9dacf24fcc170d9995e511669a082856a91f958a2fe380bfab3fb22" + [[package]] name = "once_cell" version = "1.4.0" diff --git a/src/table/Cargo.toml b/src/table/Cargo.toml index 1963f3da..945763fa 100644 --- a/src/table/Cargo.toml +++ b/src/table/Cargo.toml @@ -21,6 +21,7 @@ rand = "0.7" hex = "0.3" arc-swap = "0.4" log = "0.4" +hexdump = "0.1" sled = "0.31" diff --git a/src/table/table.rs b/src/table/table.rs index 54a42d34..5dfee3c8 100644 --- a/src/table/table.rs +++ b/src/table/table.rs @@ -464,6 +464,9 @@ where Some(x) => Ok(x), None => { warn!("Unable to decode entry of {}: {}", self.name, e); + for line in hexdump::hexdump_iter(bytes) { + debug!("{}", line); + } Err(e.into()) } }, -- cgit v1.2.3