From: Samuel Just Date: Tue, 4 Mar 2014 01:08:10 +0000 (-0800) Subject: PGBackend/ECBackend: handle temp objects correctly X-Git-Tag: v0.78~90^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f2a4eec1d68524a13951ba48ecb71d0855453b68;p=ceph.git PGBackend/ECBackend: handle temp objects correctly Signed-off-by: Samuel Just --- diff --git a/src/osd/ECBackend.cc b/src/osd/ECBackend.cc index f83d2977a566..64bdd2f7e7bf 100644 --- a/src/osd/ECBackend.cc +++ b/src/osd/ECBackend.cc @@ -1409,7 +1409,7 @@ ECUtil::HashInfoRef ECBackend::get_hash_info( dout(10) << __func__ << ": not in cache " << hoid << dendl; struct stat st; int r = store->stat( - coll, + hoid.is_temp() ? temp_coll : coll, ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), &st); ECUtil::HashInfo hinfo(ec_impl->get_chunk_count()); @@ -1417,7 +1417,7 @@ ECUtil::HashInfoRef ECBackend::get_hash_info( dout(10) << __func__ << ": found on disk, size " << st.st_size << dendl; bufferlist bl; r = store->getattr( - coll, + hoid.is_temp() ? temp_coll : coll, ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), ECUtil::get_hinfo_key(), bl); diff --git a/src/osd/PGBackend.cc b/src/osd/PGBackend.cc index 3841ede95ca3..f6698a1864de 100644 --- a/src/osd/PGBackend.cc +++ b/src/osd/PGBackend.cc @@ -173,7 +173,7 @@ int PGBackend::objects_get_attr( { bufferptr bp; int r = store->getattr( - coll, + hoid.is_temp() ? temp_coll : coll, ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), attr.c_str(), bp); @@ -189,7 +189,7 @@ int PGBackend::objects_get_attrs( map *out) { return store->getattrs( - coll, + hoid.is_temp() ? temp_coll : coll, ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), *out); } @@ -200,6 +200,7 @@ void PGBackend::rollback_setattrs( ObjectStore::Transaction *t) { map to_set; set to_remove; + assert(!hoid.is_temp()); for (map >::iterator i = old_attrs.begin(); i != old_attrs.end(); ++i) { @@ -222,6 +223,7 @@ void PGBackend::rollback_append( const hobject_t &hoid, uint64_t old_size, ObjectStore::Transaction *t) { + assert(!hoid.is_temp()); t->truncate( coll, ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard), @@ -232,6 +234,7 @@ void PGBackend::rollback_stash( const hobject_t &hoid, version_t old_version, ObjectStore::Transaction *t) { + assert(!hoid.is_temp()); t->remove(coll, hoid); t->collection_move_rename( coll, @@ -243,6 +246,7 @@ void PGBackend::rollback_stash( void PGBackend::rollback_create( const hobject_t &hoid, ObjectStore::Transaction *t) { + assert(!hoid.is_temp()); t->remove( coll, ghobject_t(hoid, ghobject_t::NO_GEN, get_parent()->whoami_shard().shard)); @@ -252,6 +256,7 @@ void PGBackend::trim_stashed_object( const hobject_t &hoid, version_t old_version, ObjectStore::Transaction *t) { + assert(!hoid.is_temp()); t->remove( coll, ghobject_t(hoid, old_version, get_parent()->whoami_shard().shard)); }