summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-19 18:24:22 -0700
committerSage Weil <sage@inktank.com>2013-10-02 16:53:08 -0700
commit8148b9088fea5e9e6807cd8d4e2b389f9964b008 (patch)
treea7a2403574303634934f293fd951fee73fa9696f
parentd05ce45f80ea804e9682f06c430c901155060263 (diff)
downloadceph-8148b9088fea5e9e6807cd8d4e2b389f9964b008.tar.gz
osd: add last_archived_bloom to pg_info_t
This field will track the most recent eversion recorded in an archived bloom_filter. Any events after this point in the pg log have not yet been archived and should therefore be included in the in-memory bloom filter. Signed-off-by: Sage Weil <sage@inktank.com>
-rw-r--r--src/osd/osd_types.cc10
-rw-r--r--src/osd/osd_types.h4
2 files changed, 12 insertions, 2 deletions
diff --git a/src/osd/osd_types.cc b/src/osd/osd_types.cc
index cda487617bf..778d3b7f609 100644
--- a/src/osd/osd_types.cc
+++ b/src/osd/osd_types.cc
@@ -1664,7 +1664,7 @@ void pg_history_t::generate_test_instances(list<pg_history_t*>& o)
void pg_info_t::encode(bufferlist &bl) const
{
- ENCODE_START(28, 26, bl);
+ ENCODE_START(29, 26, bl);
::encode(pgid, bl);
::encode(last_update, bl);
::encode(last_complete, bl);
@@ -1675,12 +1675,13 @@ void pg_info_t::encode(bufferlist &bl) const
::encode(purged_snaps, bl);
::encode(last_epoch_started, bl);
::encode(last_user_version, bl);
+ ::encode(last_archived_bloom, bl);
ENCODE_FINISH(bl);
}
void pg_info_t::decode(bufferlist::iterator &bl)
{
- DECODE_START_LEGACY_COMPAT_LEN(28, 26, 26, bl);
+ DECODE_START_LEGACY_COMPAT_LEN(29, 26, 26, bl);
if (struct_v < 23) {
old_pg_t opgid;
::decode(opgid, bl);
@@ -1714,6 +1715,10 @@ void pg_info_t::decode(bufferlist::iterator &bl)
::decode(last_user_version, bl);
else
last_user_version = last_update.version;
+ if (struct_v >= 29)
+ ::decode(last_archived_bloom, bl);
+ else
+ last_archived_bloom = eversion_t();
DECODE_FINISH(bl);
}
@@ -1739,6 +1744,7 @@ void pg_info_t::dump(Formatter *f) const
f->dump_int("dne", dne());
f->dump_int("incomplete", is_incomplete());
f->dump_int("last_epoch_started", last_epoch_started);
+ f->dump_stream("last_archived_bloom") << last_archived_bloom;
}
void pg_info_t::generate_test_instances(list<pg_info_t*>& o)
diff --git a/src/osd/osd_types.h b/src/osd/osd_types.h
index 1babd58dc12..fb71c4f3f41 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -1376,6 +1376,8 @@ struct pg_info_t {
version_t last_user_version; // last user object version applied to store
+ eversion_t last_archived_bloom; ///< last update in an archived bloom filter
+
eversion_t log_tail; // oldest log entry.
hobject_t last_backfill; // objects >= this and < last_complete may be missing
@@ -1422,6 +1424,8 @@ inline ostream& operator<<(ostream& out, const pg_info_t& pgi)
out << " (" << pgi.log_tail << "," << pgi.last_update << "]";
if (pgi.is_incomplete())
out << " lb " << pgi.last_backfill;
+ if (pgi.last_archived_bloom != eversion_t())
+ out << " lab " << pgi.last_archived_bloom;
}
//out << " c " << pgi.epoch_created;
out << " local-les=" << pgi.last_epoch_started;