From 56fb027f2af915227aff8c56cecc4bb93f494b82 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Thu, 12 Apr 2012 16:14:44 -0700 Subject: [PATCH] test_idempotent_sequence: make get-last-op return 0 if no txns applied Signed-off-by: Sage Weil --- src/test/filestore_test/test_idempotent_sequence.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/filestore_test/test_idempotent_sequence.cc b/src/test/filestore_test/test_idempotent_sequence.cc index ffb84ddf5b2f2..78eaa19f9772d 100644 --- a/src/test/filestore_test/test_idempotent_sequence.cc +++ b/src/test/filestore_test/test_idempotent_sequence.cc @@ -301,9 +301,11 @@ int run_get_last_op(std::string& filestore_path, std::string& journal_path) hobject_t txn_object(sobject_t("txn", CEPH_NOSNAP)); bufferlist bl; store->read(txn_coll, txn_object, 0, 100, bl); - bufferlist::iterator p = bl.begin(); - int32_t txn; - ::decode(txn, p); + int32_t txn = 0; + if (bl.length()) { + bufferlist::iterator p = bl.begin(); + ::decode(txn, p); + } store->umount(); delete store; -- 2.39.5