From: Sage Weil Date: Fri, 5 Dec 2014 17:39:49 +0000 (-0800) Subject: osd: drop snap_collections X-Git-Tag: v0.91~23^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=880135abfbf9b4b77510367e80a22995422afa85;p=ceph.git osd: drop snap_collections This is obsolete since cuttlefish. Signed-off-by: Sage Weil --- diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index 9cdc7f8f3d41..d32e4a87e291 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -2810,15 +2810,6 @@ void OSD::load_pgs() } } - if (!pg->snap_collections.empty()) { - pg->snap_collections.clear(); - pg->dirty_big_info = true; - pg->dirty_info = true; - ObjectStore::Transaction t; - pg->write_if_dirty(t); - store->apply_transaction(t); - } - service.init_splits_between(pg->info.pgid, pg->get_osdmap(), osdmap); // generate state for PG's current mapping diff --git a/src/osd/PG.cc b/src/osd/PG.cc index 3ef6eacff362..7e63bb44ef0d 100644 --- a/src/osd/PG.cc +++ b/src/osd/PG.cc @@ -2626,13 +2626,11 @@ void PG::_upgrade_v7(ObjectStore *store, const interval_set &snapcolls } objects.clear(); } - snap_collections.clear(); } int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch, pg_info_t &info, coll_t coll, map &past_intervals, - interval_set &snap_collections, ghobject_t &pgmeta_oid, bool dirty_big_info) { @@ -2650,7 +2648,6 @@ int PG::_write_info(ObjectStore::Transaction& t, epoch_t epoch, // potentially big stuff bufferlist& bigbl = v[biginfo_key]; ::encode(past_intervals, bigbl); - ::encode(snap_collections, bigbl); ::encode(info.purged_snaps, bigbl); //dout(20) << "write_info bigbl " << bigbl.length() << dendl; } @@ -2695,7 +2692,7 @@ void PG::write_info(ObjectStore::Transaction& t) unstable_stats.clear(); int ret = _write_info(t, get_osdmap()->get_epoch(), info, coll, - past_intervals, snap_collections, pgmeta_oid, + past_intervals, pgmeta_oid, dirty_big_info); assert(ret == 0); last_persisted_osdmap_ref = osdmap_ref; @@ -2928,7 +2925,7 @@ std::string PG::get_corrupt_pg_log_name() const int PG::read_info( ObjectStore *store, spg_t pgid, const coll_t &coll, bufferlist &bl, pg_info_t &info, map &past_intervals, - interval_set &snap_collections, __u8 &struct_v) + __u8 &struct_v) { // try for v8 or later set keys; @@ -2950,7 +2947,6 @@ int PG::read_info( p = values[biginfo_key].begin(); ::decode(past_intervals, p); - ::decode(snap_collections, p); ::decode(info.purged_snaps, p); return 0; } @@ -3002,13 +2998,8 @@ int PG::read_info( if (struct_v < 3) { set snap_collections_temp; ::decode(snap_collections_temp, p); - snap_collections.clear(); - for (set::iterator i = snap_collections_temp.begin(); - i != snap_collections_temp.end(); - ++i) { - snap_collections.insert(*i); - } } else { + interval_set snap_collections; ::decode(snap_collections, p); if (struct_v >= 4 && struct_v < 6) ::decode(info, p); @@ -3021,7 +3012,7 @@ int PG::read_info( void PG::read_state(ObjectStore *store, bufferlist &bl) { int r = read_info(store, pg_id, coll, bl, info, past_intervals, - snap_collections, info_struct_v); + info_struct_v); assert(r >= 0); ostringstream oss; diff --git a/src/osd/PG.h b/src/osd/PG.h index 793277ea5a7a..1670d8661e76 100644 --- a/src/osd/PG.h +++ b/src/osd/PG.h @@ -425,7 +425,6 @@ public: } } missing_loc; - interval_set snap_collections; // obsolete map past_intervals; interval_set snap_trimq; @@ -2105,7 +2104,6 @@ public: static int _write_info(ObjectStore::Transaction& t, epoch_t epoch, pg_info_t &info, coll_t coll, map &past_intervals, - interval_set &snap_collections, ghobject_t &pgmeta_oid, bool dirty_big_info); void write_if_dirty(ObjectStore::Transaction& t); @@ -2132,7 +2130,7 @@ public: static int read_info( ObjectStore *store, spg_t pgid, const coll_t &coll, bufferlist &bl, pg_info_t &info, map &past_intervals, - interval_set &snap_collections, __u8 &); + __u8 &); void read_state(ObjectStore *store, bufferlist &bl); static bool _has_removal_flag(ObjectStore *store, spg_t pgid); static epoch_t peek_map_epoch(ObjectStore *store, spg_t pgid, bufferlist *bl); diff --git a/src/tools/ceph_objectstore_tool.cc b/src/tools/ceph_objectstore_tool.cc index 87f2d94e5aac..50a87a62a4d8 100644 --- a/src/tools/ceph_objectstore_tool.cc +++ b/src/tools/ceph_objectstore_tool.cc @@ -716,10 +716,8 @@ int mark_pg_for_removal(ObjectStore *fs, spg_t pgid, ObjectStore::Transaction *t bufferlist bl; PG::peek_map_epoch(fs, pgid, &bl); map past_intervals; - interval_set snap_collections; __u8 struct_v; - int r = PG::read_info(fs, pgid, coll, bl, info, past_intervals, - snap_collections, struct_v); + int r = PG::read_info(fs, pgid, coll, bl, info, past_intervals, struct_v); if (r < 0) { cerr << __func__ << " error on read_info " << cpp_strerror(-r) << std::endl; return r; @@ -803,13 +801,11 @@ int write_info(ObjectStore::Transaction &t, epoch_t epoch, pg_info_t &info, map &past_intervals) { //Empty for this - interval_set snap_collections; // obsolete coll_t coll(info.pgid); ghobject_t pgmeta_oid(info.pgid.make_pgmeta_oid()); int ret = PG::_write_info(t, epoch, info, coll, past_intervals, - snap_collections, pgmeta_oid, true); if (ret < 0) ret = -ret; @@ -2817,10 +2813,9 @@ int main(int argc, char **argv) pg_info_t info(pgid); map past_intervals; - interval_set snap_collections; __u8 struct_ver; r = PG::read_info(fs, pgid, coll, bl, info, past_intervals, - snap_collections, struct_ver); + struct_ver); if (r < 0) { cerr << "read_info error " << cpp_strerror(-r) << std::endl; ret = 1;