From aac2d1e04c3ee3c329473c4582f46854135ce43c Mon Sep 17 00:00:00 2001 From: Konstantin Knizhnik Date: Sat, 8 May 2021 16:12:39 +0300 Subject: [PATCH] Fix bug in NodeId serialization --- walkeeper/src/wal_service.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/walkeeper/src/wal_service.rs b/walkeeper/src/wal_service.rs index 7e64a91eb5..280c7b611a 100644 --- a/walkeeper/src/wal_service.rs +++ b/walkeeper/src/wal_service.rs @@ -194,14 +194,14 @@ fn parse_hex_str(s: &str) -> Result { impl Serializer for NodeId { fn pack(&self, buf: &mut BytesMut) { - buf.put_u128_le(self.uuid); - buf.put_u64(self.term); // use big endian to provide compatibility with memcmp + buf.put_u64_le(self.term); + buf.put_u128(self.uuid); // use big endian to provide compatibility with memcmp } fn unpack(buf: &mut BytesMut) -> NodeId { NodeId { - uuid: buf.get_u128_le(), - term: buf.get_u64(), // use big endian to provide compatibility with memcmp + term: buf.get_u64_le(), + uuid: buf.get_u128(), // use big endian to provide compatibility with memcmp } } }