From: xie xingguo Date: Sun, 17 Jan 2016 14:03:56 +0000 (+0800) Subject: BlueStore: improve wal_replay logic a little bit X-Git-Tag: v10.0.4~195^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a671448f90a97aba30fe318b464588c612fdc375;p=ceph.git BlueStore: improve wal_replay logic a little bit Fixes: #14392 Signed-off-by: xie xingguo --- diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index fb7cfe3be44a..b65deaae8991 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -3868,17 +3868,19 @@ int BlueStore::_wal_replay() for (it->lower_bound(string()); it->valid(); it->next(), ++count) { dout(20) << __func__ << " replay " << pretty_binary_string(it->key()) << dendl; - TransContext *txc = _txc_create(osr.get()); - txc->wal_txn = new bluestore_wal_transaction_t; + bluestore_wal_transaction_t *wal_txn = new bluestore_wal_transaction_t; bufferlist bl = it->value(); bufferlist::iterator p = bl.begin(); try { - ::decode(*txc->wal_txn, p); + ::decode(*wal_txn, p); } catch (buffer::error& e) { derr << __func__ << " failed to decode wal txn " << pretty_binary_string(it->key()) << dendl; + delete wal_txn; return -EIO; } + TransContext *txc = _txc_create(osr.get()); + txc->wal_txn = wal_txn; txc->state = TransContext::STATE_KV_DONE; _txc_state_proc(txc); }