diff --git a/Cargo.lock b/Cargo.lock index 20185de3cc..0e47a32f9a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -462,9 +462,9 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.5.0" +version = "3.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f07aa6688c702439a1be0307b6a94dffe1168569e45b9500c1372bc580740d59" +checksum = "099e596ef14349721d9016f6b80dd3419ea1bf289ab9b44df8e4dfd3a005d5d9" [[package]] name = "byte-pool" @@ -745,6 +745,16 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctor" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8f45d9ad417bcef4817d614a501ab55cdd96a6fdb24f49aab89a54acfd66b19" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "ctr" version = "0.6.0" @@ -801,9 +811,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.3.1" +version = "2.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993a608597367c6377b258c25d7120740f00ed23a2252b729b1932dd7866f908" +checksum = "3ee2393c4a91429dffb4bedf19f4d6abf27d8a732c8ce4980305d782e5426d57" [[package]] name = "der-oid-macro" @@ -1277,9 +1287,9 @@ dependencies = [ [[package]] name = "fluvio-protocol-core" -version = "0.2.1" +version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fba0d7122118bf5e2f9ec81f96976ba42bf0d2855745a8cd12d6bfd06fd9a436" +checksum = "60265c4636c4de93156d25aa9ae0869e2133009733f50c3cef57886ca0641ebe" dependencies = [ "bytes 0.5.6", "log", @@ -1385,9 +1395,9 @@ dependencies = [ [[package]] name = "fluvio-socket" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d530baae0b8673114a1200f0848c7936132b6a9083c6165cc86508023b2d3b" +checksum = "1385eee2d85fec96934a49a568874a89061c86a56fc55bdfa6ddcb687834bcef" dependencies = [ "async-channel", "async-mutex", @@ -1771,7 +1781,7 @@ checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" dependencies = [ "cfg-if 1.0.0", "libc", - "wasi 0.10.1+wasi-snapshot-preview1", + "wasi 0.10.2+wasi-snapshot-preview1", ] [[package]] @@ -1939,9 +1949,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.3.4" +version = "1.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +checksum = "615caabe2c3160b313d52ccc905335f4ed5f10881dd63dc5699d47e90be85691" [[package]] name = "httpdate" @@ -2150,9 +2160,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.82" +version = "0.2.85" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" +checksum = "7ccac4b00700875e6a07c6cde370d44d32fa01c5a65cdd2fca6858c479d28bb3" [[package]] name = "linked-hash-map" @@ -2162,11 +2172,12 @@ checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "log" -version = "0.4.13" +version = "0.4.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf3805d4480bb5b86070dcfeb9e2cb2ebc148adb753c5cca5f884d1d65a42b2" +checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", + "value-bag", ] [[package]] @@ -2392,9 +2403,9 @@ dependencies = [ [[package]] name = "owo-colors" -version = "1.2.1" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13370dae44474229701bb69b90b4f4dca6404cb0357a2d50d635f1171dc3aa7b" +checksum = "2386b4ebe91c2f7f51082d4cefa145d030e33a1842a96b12e4885cc3c01f7a55" [[package]] name = "parking" @@ -2982,9 +2993,9 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.15" +version = "0.8.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "971be8f6e4d4a47163b405a3df70d14359186f9ab0f3a3ec37df144ca1ce089f" +checksum = "bdd2af560da3c1fdc02cb80965289254fc35dff869810061e2d8290ee48848ae" dependencies = [ "dtoa", "linked-hash-map", @@ -3000,9 +3011,9 @@ checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" [[package]] name = "sha2" -version = "0.9.2" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e7aab86fe2149bad8c507606bdb3f4ef5e7b2380eb92350f56122cca72a42a8" +checksum = "fa827a14b29ab7f44778d14a88d3cb76e949c45083f7dbfa507d0cb699dc12de" dependencies = [ "block-buffer", "cfg-if 1.0.0", @@ -3330,9 +3341,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.2.24" +version = "0.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +checksum = "6703a273949a90131b290be1fe7b039d0fc884aa1935860dfcbe056f28cd8092" dependencies = [ "bytes 0.5.6", "fnv", @@ -3546,6 +3557,15 @@ dependencies = [ "serde", ] +[[package]] +name = "value-bag" +version = "1.0.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b676010e055c99033117c2343b33a40a30b91fecd6c49055ac9cd2d6c305ab1" +dependencies = [ + "ctor", +] + [[package]] name = "vcpkg" version = "0.2.11" @@ -3600,9 +3620,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.1+wasi-snapshot-preview1" +version = "0.10.2+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93c6c3420963c5c64bca373b25e77acb562081b9bb4dd5bb864187742186cea9" +checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6" [[package]] name = "wasm-bindgen" diff --git a/VERSION b/VERSION index 27d43f42d8..26eb302821 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.7.0-alpha.2 \ No newline at end of file +0.7.0-alpha.3 \ No newline at end of file diff --git a/src/auth/src/x509/authenticator.rs b/src/auth/src/x509/authenticator.rs index d56bae7d4c..ffdad32fa3 100644 --- a/src/auth/src/x509/authenticator.rs +++ b/src/auth/src/x509/authenticator.rs @@ -62,6 +62,9 @@ impl X509Authenticator { .await .map_err(|err| match err { fluvio_socket::FlvSocketError::IoError { source } => source, + fluvio_socket::FlvSocketError::SocketClosed => { + IoError::new(IoErrorKind::BrokenPipe, "connection closed") + } fluvio_socket::FlvSocketError::SendFileError { .. } => { panic!("shoud not be doing zero copy here") } diff --git a/src/controlplane-metadata/src/topic/spec.rs b/src/controlplane-metadata/src/topic/spec.rs index 34af654257..b9aeb8322f 100644 --- a/src/controlplane-metadata/src/topic/spec.rs +++ b/src/controlplane-metadata/src/topic/spec.rs @@ -722,20 +722,13 @@ pub mod test { let result = topic_spec.encode(&mut dest, 0); assert!(result.is_ok()); let expected_dest = [ - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x13, 0x89, 0x00, 0x00, 0x13, - 0x8a, - ]; - - /* - let expected_dest = [ - 0, 2, 0, 0, 0, 0, 4, 0, 0, - 0x00, - 0x02, // partition cnt + 0x00, // type + 0x00, 0x00, 0x00, 0x01, // partition cnt 0x00, 0x00, 0x00, 0x00, // partition id 0x00, 0x00, 0x00, 0x02, // replica cnt 0x00, 0x00, 0x13, 0x89, // spu id: 5001 0x00, 0x00, 0x13, 0x8a, // spu id: 5002 - ];*/ + ]; assert_eq!(dest, expected_dest); // test encode diff --git a/src/dataplane-protocol/src/batch.rs b/src/dataplane-protocol/src/batch.rs index d62ccca944..d51e3ee3ec 100644 --- a/src/dataplane-protocol/src/batch.rs +++ b/src/dataplane-protocol/src/batch.rs @@ -243,7 +243,7 @@ mod test { let decoded_record = batch.records.get(0).unwrap(); println!("record crc: {}", batch.header.crc); - assert_eq!(batch.header.crc, 1910360147); + assert_eq!(batch.header.crc, 2908671645); let b = decoded_record.value.as_ref(); assert_eq!(b, b"test"); diff --git a/src/dataplane-protocol/src/record.rs b/src/dataplane-protocol/src/record.rs index aa69348b4d..a5577d27e4 100644 --- a/src/dataplane-protocol/src/record.rs +++ b/src/dataplane-protocol/src/record.rs @@ -433,15 +433,17 @@ mod test { #[test] fn test_decode_encode_record() -> Result<(), IoError> { - /* - * Below is how you generate the vec for the `data` varible below. + /* Below is how you generate the vec for the `data` varible below. let mut record = DefaultRecord::from(String::from("dog")); record.preamble.set_offset_delta(1); let mut out = vec![]; record.encode(&mut out, 0)?; println!("ENCODED: {:#x?}", out); */ - let data: Vec = vec![0x12, 0x0, 0x0, 0x2, 0x0, 0x6, 0x64, 0x6f, 0x67, 0x0]; + + let data = [ + 0x1e, 0x0, 0x0, 0x2, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3, 0x64, 0x6f, 0x67, 0x0, + ]; let record = DefaultRecord::decode_from(&mut Cursor::new(&data), 0)?; assert_eq!(record.as_bytes(0)?.len(), data.len()); diff --git a/src/storage/src/segment.rs b/src/storage/src/segment.rs index b2f8d9c4c8..e046303a05 100644 --- a/src/storage/src/segment.rs +++ b/src/storage/src/segment.rs @@ -453,7 +453,7 @@ mod tests { (active_segment.find_offset_position(20).await?).expect("offset exists"); assert_eq!(offset_position.get_base_offset(), 20); assert_eq!(offset_position.get_pos(), 0); // - assert_eq!(offset_position.len(), 55); + assert_eq!(offset_position.len(), 64); assert!((active_segment.find_offset_position(30).await?).is_none()); Ok(()) } @@ -492,7 +492,7 @@ mod tests { (active_segment.find_offset_position(20).await?).expect("offset exists"); assert_eq!(offset_position.get_base_offset(), 20); assert_eq!(offset_position.get_pos(), 0); // - assert_eq!(offset_position.len(), 82); + assert_eq!(offset_position.len(), 109); assert!((active_segment.find_offset_position(30).await?).is_none()); Ok(()) @@ -516,10 +516,10 @@ mod tests { assert_eq!(seg_sink.get_end_offset(), 46); - assert_eq!(seg_sink.get_log_pos(), 228); // each takes 91 bytes + assert_eq!(seg_sink.get_log_pos(), 273); // each takes 91 bytes let index = seg_sink.get_index(); - assert_eq!(index[0].to_be(), (2, 76)); + assert_eq!(index[0].to_be(), (2, 91)); let bytes = read_bytes_from_file(&test_dir.join(TEST2_FILE_NAME))?; debug!("read {} bytes", bytes.len()); @@ -536,16 +536,16 @@ mod tests { let offset_pos1 = seg_sink.find_offset_position(40).await?.expect("pos"); assert_eq!(offset_pos1.get_base_offset(), 40); assert_eq!(offset_pos1.get_pos(), 0); - assert_eq!(offset_pos1.len(), 64); + assert_eq!(offset_pos1.len(), 79); let offset_pos2 = seg_sink.find_offset_position(42).await?.expect("pos"); assert_eq!(offset_pos2.get_base_offset(), 42); - assert_eq!(offset_pos2.get_pos(), 76); - assert_eq!(offset_pos2.len(), 64); + assert_eq!(offset_pos2.get_pos(), 91); + assert_eq!(offset_pos2.len(), 79); let offset_pos3 = seg_sink.find_offset_position(44).await?.expect("pos"); assert_eq!(offset_pos3.get_base_offset(), 44); - assert_eq!(offset_pos3.get_pos(), 152); - assert_eq!(offset_pos3.len(), 64); + assert_eq!(offset_pos3.get_pos(), 182); + assert_eq!(offset_pos3.len(), 79); // test whether you can send batch with non zero base offset let mut next_batch = create_batch();