summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSage Weil <sage@inktank.com>2013-09-19 18:24:22 -0700
committerSage Weil <sage@inktank.com>2013-09-19 18:27:08 -0700
commit7fb1f78ed0a87c41551e96012f679f1c50189683 (patch)
tree70e59d4e5229622fc39c596554756f161ebd4013
parentb4e14524072e3a3f1ca831b479017f5e68366168 (diff)
downloadceph-7fb1f78ed0a87c41551e96012f679f1c50189683.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 589dcaed67f..0f88cc2ac82 100644
--- a/src/osd/osd_types.cc
+++ b/src/osd/osd_types.cc
@@ -1654,7 +1654,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);
@@ -1665,12 +1665,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);
@@ -1704,6 +1705,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);
}
@@ -1729,6 +1734,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 e5631b2c67e..c66d75c68b1 100644
--- a/src/osd/osd_types.h
+++ b/src/osd/osd_types.h
@@ -1369,6 +1369,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
@@ -1415,6 +1417,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;