summaryrefslogtreecommitdiff
path: root/src/osd/PGLog.h
diff options
context:
space:
mode:
authorSamuel Just <sam.just@inktank.com>2013-08-27 08:49:14 -0700
committerSamuel Just <sam.just@inktank.com>2013-08-27 15:40:28 -0700
commita9bacd7b80f5d0be91c1e9b58965291a59b50d0a (patch)
tree765608d0ff4aa958a63bfd97d6224905d01635bf /src/osd/PGLog.h
parentfec6e90dde6ad9436e0b852c7f1e0a42b9d7ba60 (diff)
downloadceph-wip-dumpling-perf2.tar.gz
PGLog: maintain writeout_from and trimmedwip-dumpling-perf2
This way, we can avoid omap_rmkeyrange in the common append and trim cases. Signed-off-by: Samuel Just <sam.just@inktank.com>
Diffstat (limited to 'src/osd/PGLog.h')
-rw-r--r--src/osd/PGLog.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/osd/PGLog.h b/src/osd/PGLog.h
index b524c60c00a..27d483770dc 100644
--- a/src/osd/PGLog.h
+++ b/src/osd/PGLog.h
@@ -142,7 +142,7 @@ struct PGLog {
caller_ops[e.reqid] = &(log.back());
}
- void trim(eversion_t s);
+ void trim(eversion_t s, set<eversion_t> *trimmed = 0);
ostream& print(ostream& out) const;
};
@@ -160,6 +160,8 @@ protected:
bool touched_log;
eversion_t dirty_to;
eversion_t dirty_from;
+ eversion_t writeout_from;
+ set<eversion_t> trimmed;
bool dirty_divergent_priors;
CephContext *cct;
@@ -167,7 +169,9 @@ protected:
return !touched_log ||
(dirty_to != eversion_t()) ||
(dirty_from != eversion_t::max()) ||
- dirty_divergent_priors;
+ dirty_divergent_priors ||
+ (writeout_from != eversion_t::max()) ||
+ !(trimmed.empty());
}
void mark_dirty_to(eversion_t to) {
if (to > dirty_to)
@@ -177,6 +181,10 @@ protected:
if (from < dirty_from)
dirty_from = from;
}
+ void mark_writeout_from(eversion_t from) {
+ if (from < writeout_from)
+ writeout_from = from;
+ }
void add_divergent_prior(eversion_t version, hobject_t obj) {
divergent_priors.insert(make_pair(version, obj));
dirty_divergent_priors = true;
@@ -221,6 +229,8 @@ protected:
dirty_from = eversion_t::max();
dirty_divergent_priors = false;
touched_log = true;
+ trimmed.clear();
+ writeout_from = eversion_t::max();
check();
}
public:
@@ -281,7 +291,7 @@ public:
void unindex() { log.unindex(); }
void add(pg_log_entry_t& e) {
- mark_dirty_from(e.version);
+ mark_writeout_from(e.version);
log.add(e);
}
@@ -374,6 +384,8 @@ public:
const hobject_t &log_oid, map<eversion_t, hobject_t> &divergent_priors,
eversion_t dirty_to,
eversion_t dirty_from,
+ eversion_t writeout_from,
+ const set<eversion_t> &trimmed,
bool dirty_divergent_priors,
bool touch_log,
set<string> *log_keys_debug