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>
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>
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>