From 1e44a5ecbc3262cf964c0180f47097736bb40003 Mon Sep 17 00:00:00 2001 From: Glauber Costa Date: Thu, 21 May 2015 08:59:31 -0400 Subject: [PATCH] sstables: summary: fix a bug when reading position Since that whole entries array is memory mapped, we should not call read_integer - which will byteswap it. We should instead just fetch the position directly. This was not spotted before because our test sstables tend to be relatively small. Signed-off-by: Glauber Costa --- sstables/sstables.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sstables/sstables.cc b/sstables/sstables.cc index d874cd30f7ca..e158e81de704 100644 --- a/sstables/sstables.cc +++ b/sstables/sstables.cc @@ -504,7 +504,8 @@ future<> parse(random_access_reader& in, summary& s) { auto keysize = entrysize - 8; entry.key = bytes(reinterpret_cast(buf.get()), keysize); buf.trim_front(keysize); - read_integer(buf, entry.position); + // FIXME: This is a le read. We should make this explicit + entry.position = *(reinterpret_cast *>(buf.get())); return make_ready_future<>(); });