{
dout(10) << __func__ << " zone 0x" << std::hex << zone << std::dec << dendl;
- if (true) {
- string key;
- _key_encode_u64(zone, &key);
- KeyValueDB::Iterator it = kvdb->get_iterator(info_prefix);
- it->lower_bound(key);
- zone_state_t zs;
- load_zone_state_from_db(zone, zs, it);
- dout(20) << __func__ << " before " << zs << dendl;
- }
KeyValueDB::Transaction txn = kvdb->get_transaction();
zone_state_t empty_zone_state;
// block here until this commits so that we don't end up starting to allocate and
// write to the new zone before this fully commits.
kvdb->submit_transaction_sync(txn);
-
- if (true) {
- // read it back to verify it is really zero!
- string key;
- _key_encode_u64(zone, &key);
- KeyValueDB::Iterator it = kvdb->get_iterator(info_prefix);
- it->lower_bound(key);
- zone_state_t zs;
- load_zone_state_from_db(zone, zs, it);
- dout(20) << __func__ << " read back " << zs << dendl;
- ceph_assert(zs.num_dead_bytes == 0);
- ceph_assert(zs.write_pointer == 0);
- }
}