osd_types: pg_t: add get_ancestor() method

Give us the ancestor for when the pool had a past value for pg_num.

Signed-off-by: Sage Weil <sage@inktank.com>
ReplicatedPG::mark_all_unfound_lost: delete local copy if necessary

There might be a local copy for an EC pool in the DELETE case.  The replica
copies should be already handled by merge_log.

Fixes: #7439
Signed-off-by: Samuel Just <sam.just@inktank.com>
PG::PriorSet: consider lost osds in up_now for pcontdec

Otherwise, the pg will remain down even as osds are marked lost.

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd: use parent pgid (as appropriate) in generate_past_intervals()

Feed in the ancestor pg_t (if any) when we are looking at intervals for
previous maps that may have preceded a recent split.

Fixes: #8139
Signed-off-by: Sage Weil <sage@inktank.com>
osd: change in up set primary constitutes a peering interval change

In several places, a change in the up_primary triggers a new peering
interval, but the palces that actually generate the new past intervals,
including check_new_interval(), did not enforce that.  This becomes
somewhat obvious when you see that those callers are ignoring the
up_primary output argument for pg_to_up_acting_osds().

Fix this by adding arguments to check_new_interval and fixing the callers
to pass them in properly.  Add a unit test case to verify this.

Note that the past interval struct itself does not record who the
up_primary was; possibly it should.

Fixes: #8139
Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: pg_interval_t: dump primary

Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: pg_interval_t: include up_primary in pg_interval_t

Nothing uses this, but it triggers a new interval, which makes it confusing
when it is not recording in the interval itself.  Let's add it now.

Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: pg_interval_t: include primaries in operator<<

Also make up vs acting explicit.

Signed-off-by: Sage Weil <sage@inktank.com>
doc/release-notes: a bit of prose about firefly

Signed-off-by: Sage Weil <sage@inktank.com>
osdc/Objecter: drop unused field

This as missed by 860d72770cdf092c027d50f4ee03bed76c975599.

** CID 1204296:  Uninitialized scalar field  (UNINIT_CTOR)
/osdc/Objecter.h: 1165 in Objecter::Op::Op(const object_t &, const
object_locator_t &, std::vector<OSDOp, std::allocator<OSDOp>> &, int, Context *,
Context *, unsigned long *)()
/osdc/Objecter.h: 1165 in Objecter::Op::Op(const object_t &, const
object_locator_t &, std::vector<OSDOp, std::allocator<OSDOp>> &, int, Context *,
Context *, unsigned long *)()

Signed-off-by: Sage Weil <sage@inktank.com>
osd/osd_types: RWState: initialize snaptrimmer_write_marker

** CID 1204295:  Uninitialized scalar field  (UNINIT_CTOR)
/osd/osd_types.h: 2716 in ObjectContext::RWState::RWState()()

Signed-off-by: Sage Weil <sage@inktank.com>
mds: make strncpy in ::respawn safer

Previous code assumed null terminated argv[0]
was not longer than PATH_MAX and the resulting
strncpy was not strictly safe.

Modify the bounds to ensure that copy will not
result in an unterminated string if argv[0]
is oversized.

Signed-off-by: John Spray <john.spray@inktank.com>
Merge pull request #1711 from ceph/wip-coverity-respawn

mds: make strncpy in ::respawn safer

Reviewed-by: Sage Weil <sage@inktank.com>
Merge pull request #1710 from ceph/wip-coverity

a couple coverity fixes

Reviewed-by: Yehuda Sadeh <yehuda@inktank.com>
ECBackend: use std::swap for boost::optional

Reviewed-by: Sage Weil <sage@inktank.com>
Signed-off-by: Samuel Just <sam.just@inktank.com>
Merge pull request #1691 from ceph/wip-8139

osd_types: pg_t: allow is_split to handle checks for splits prior to the most recent

Reviewed-by: Samuel Just <sam.just@inktank.com>
qa/workunits/rbd/copy.sh: fix test

I broke this in commit 9d64ac66082bd108ec3c2a74e2e77475b5564eae.

Signed-off-by: Sage Weil <sage@inktank.com>
Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
qa/workunits/rbd/copy.sh: skip some tests when tiering is enabled

The rados ls bit doesn't work.

Signed-off-by: Sage Weil <sage@inktank.com>
Reviewed-by: Josh Durgin <josh.durgin@inktank.com>
ReplicatedPG: enable mark_unfound_lost delete for ec pools

revert is tricky to implement at this time for ec pools, so
we'll instead just implement delete for ec pools.

Fixes: #7439
Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG: handle ec pools in mark_all_unfound_lost

Signed-off-by: Samuel Just <sam.just@inktank.com>