If the pgls.start_epoch is set, the cookie is only considered valid if the
osd pg interval has not changed since then. If it has, then the cookie
is no longer valid and is ignored, effectively restarting the pgls process.
Old clients never set this and are unaffected.
Signed-off-by: Sage Weil <sage.weil@dreamhost.com>
} __attribute__ ((packed)) cls;
struct {
__le64 cookie, count;
+ __le32 start_epoch; /* for the pgls sequence */
} __attribute__ ((packed)) pgls;
struct {
__le64 snapid;
PGLSResponse response;
response.handle = (collection_list_handle_t)(uint64_t)(p->op.pgls.cookie);
+ // reset cookie?
+ if (p->op.pgls.start_epoch &&
+ p->op.pgls.start_epoch < info.history.same_primary_since) {
+ dout(10) << " pgls sequence started epoch " << p->op.pgls.start_epoch
+ << " < same_primary_since " << info.history.same_primary_since
+ << ", resetting cookie" << dendl;
+ response.handle = 0;
+ }
+
uint64_t high_bit = 1ull << 63;
if ((response.handle & high_bit) == 0) {
// it's an offset into the missing set
out << ".";
op.data.write(op.op.cls.class_len, op.op.cls.method_len, out);
}
+ } else if (ceph_osd_op_type_pg(op.op.op)) {
+ switch (op.op.op) {
+ case CEPH_OSD_OP_PGLS:
+ case CEPH_OSD_OP_PGLS_FILTER:
+ out << " cookie " << op.op.pgls.cookie;
+ out << " start_epoch " << op.op.pgls.start_epoch;
+ break;
+ }
}
return out;
}