Commit Graph

99663 Commits

Author SHA1 Message Date
Andrew Schoen
e9900a11ec
Merge pull request #28836 from alfredodeza/wip-toxsleep
ceph-volume tests add a sleep in tox for slow OSDs after booting

Reviewed-by: Andrew Schoen <aschoen@redhat.com>
2019-07-02 13:51:56 -05:00
Sage Weil
43e666350d common/blkdev: fix syntax of error message
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 13:09:20 -05:00
Kefu Chai
1ec9f145a8 dmclock: pick up fix to replace uint
`uint` is not available in musl. so this change should address the FTBFS
on distros, like Alpine and Gentoo Linux, which uses musl-libc.

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-03 00:51:16 +08:00
Igor Fedotov
7bb1e7aa59 os/bluestore: more smart allocator dump when lacking space for bluefs.
Fixes: http://tracker.ceph.com/issues/40623

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
2019-07-02 19:00:49 +03:00
Sage Weil
b17850a665 osd: drop osd_lock during scrub
We do not want to hold osd_lock while calling apply_transaction or else
we may cause a deadlock due to a completion event that needs osd_lock.

Also, we don't need to hold the lock here, so don't.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 10:51:57 -05:00
Sage Weil
12c3ee10d5 osd/osd_types: drop last_backfill_bitwise member
Assert if we try to decode an info with it set to false.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 10:49:08 -05:00
Kefu Chai
2fa4013818 cmake/modules/BuildBoost.cmake: fix build for armhf
see also
https://www.boost.org/doc/libs/1_70_0/libs/context/doc/html/context/architectures.html

Signed-off-by: Kefu Chai <kchai@redhat.com>
2019-07-02 23:40:21 +08:00
Patrick Nawracay
d0fe5ce52a mgr/dashboard: Add backwards compatibility to interlock of fast-diff and object-map
Fixes: http://tracker.ceph.com/issues/39451

Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
2019-07-02 16:56:17 +02:00
Patrick Nawracay
dfeba0b139 mgr/dashboard: Interlock fast-diff and object-map
Fixes: http://tracker.ceph.com/issues/39451

Signed-off-by: Patrick Nawracay <pnawracay@suse.com>
2019-07-02 16:56:17 +02:00
Tatjana Dehler
3ec401960b mgr/dashboard: fix document rendering
Fixes: https://tracker.ceph.com/issues/40523
Signed-off-by: Tatjana Dehler <tdehler@suse.com>
2019-07-02 16:48:56 +02:00
Sage Weil
adacc20046 ceph_test_rados_api_tier_pp: tolerate ENOENT or success from deleted snap
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
5b0ed6ff9e osd: automatically scrub purged_snaps every deep scrub interval
With randomization.

We do this from tick() for simplicity.  It is a rare event, will take 10s
of seconds at most, and nothing else particularly time-sensitive is
happening from tick().

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
647cfb4603 osd: move scrub_purged_snaps to helper
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
fc2a96638d osd/OSDMap: SERVER_OCTOPUS feature bit is now significant
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
0d10e63d8d ceph_test_rados_api_snapshots_pp: drop unnecessary assert
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
85ddc1a034 mon/OSDMonitor: record last_purged_snaps_scrub from beacon to osdmap
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
4f4dedb8d6 osd: report last_purged_snaps_scrub as part of beacon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
ab475cda08 osd: log purged_snaps scrub to cluster log
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
a03e8ab662 osd: record last_purged_snaps_scrub in superblock
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
e4aed74cd4 osd/OSDMap: add last_purged_snaps_stamp to osd_xinfo_t
Record OSDs' last scrub of purged_snaps in the OSDMap.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
6b26fcd1bd mon/OSDMonitor: fix bug in try_prune_purged_snaps
If 'begin' isn't found, we'll get a [pbegin,pend) range back that was
nearby.  Only if it overlaps the [begin,end) range do we want to shorten
our range to [begin,pbegin); the old assert was making the assumption
that the lookup would only return a range that was after 'begin', but in
reality it can return was that comes before it too.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
d831abeae1 mon/OSDMonitor: record snap removal seq as purged
When we delete a selfmanaged snap we have to bump seq.  Record this as
purged so that we avoid discontinuities in the history and so our storage
is a bit more efficient.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
bc0553147b mon/OSDMonitor: do not bother reporting gaps in removed_snaps
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
d3d06bcd7c osdc/Objecter: don't worry about gap_removed_snaps from map gaps
This was an attempt to ensure that we didn't let removed_snaps slip by
when we had a discontiguous stream of OSDMaps.  In octopus, this can still
happen, but it's mostly harmless--the OSDs will periodically scrub to
clean up any resulting stray clones.  It's not worth the complexity.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
a1f649c2e7 mds/SnapServer: make not about pre-octopus compat code
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
6192fb6031 osd: implement scrub_purged_snaps command
This a naive one-shot implementation that does the full scan synchronously
in the command thread.  It shouldn't block any IO except to the extent
that it will compete for IO reading the underlying snapmapper omap object.

When we discover mapped objects that are covered by ranges of snaps that
should be purged, we requeue the snapid for trim on the relevant PG(s).
For these 'repeat' trims we skip the final step(s) to mark the snapid as
purged, since that presumably already happened some time ago.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:51 -05:00
Sage Weil
7628474723 osd/PrimaryLogPG: always remove the snap we are trimming
This doesn't change behavior (yet), since we only trim snaps that are
marked for removal in the OSDMap.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
8d9a27f5ea ceph_test_rados_api_snapshots_pp: (partial) test to reproduce stray clones
The test creates a snap, removes it, waits for it to (hopefully) purge,
and then uses that snapid in a snapc to generate a clone.

This isn't a complete test because (1) it doesn't wait for the purge to
happen (e.g., by watching the osdmaps go by), and (2) it doesn't trigger
an osd scrub_purged_snaps afterwards.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
81f7edc6bd osd: sync old purged_snaps on startup after upgrade or osd creation
This path only triggers after an upgrade or osd creation, when
purged_snaps_last < current_epoch.  When that happens, we slurp down the
old purged snaps so that we have a full history recorded locally.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
87b539c2b6 osd: record purged_snaps when we store new maps
When we get a new map, record the (new) purged_snaps.

Only do this if the OSD has purged_snaps that are in sync with the latest
OSDMap.  That means that after an upgrade, if the OSD didn't sync the
old purged_snaps on startup, it won't sync anything until it *next* starts
up.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
7315d3fdba mon/OSDMonitor: add messages to get past purged_snaps
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
4e5093cee3 mon/OSDMonitor: record pre-octopus purged snaps with first octopus map
When we public our first require_osd_release >= octopus osdmap, record
all prior purged snaps in a key linked to the previous osdmap.  We assume
this will encode and fit into a single key and transaction because the
even larger set of removed_snaps is already a member of pg_pool_t, which
is included in every osdmap.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
47fb89c072 mon/OSDMonitor: record purged_snaps for each epoch
Only do this if the mons are all running octopus (and thus there is also
a record for all the pre-octopus purged snaps).

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
847dc5fb78 mon/OSDMonitor: make_snap_epoch_key -> make_removed_snap_epoch_key
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
3217ca77cb osd/osd_types: add purged_snaps_last to OSDSuperblock
Make this 0 for old encodings or new superblocks.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
61d8407514 osd/osd_types: clean up initial values for OSDSuperblock
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
acd7e903d3 mon/OSDMonitor: make {removed,purged}_snap storage more efficient
Merge adjacent extents to keep the database smaller and lookups more
efficient.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
1e7718c37c mon/OSDMonitor: move (removed, purged) snap update into a helper
This is trivial at the moment, but we'll make it clever next.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
c0233801a8 mon/OSDMonitor: generalize/refactor lookup_*_snap
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
c0f3624345 mon/OSDMonitor: refactor snap key and value helpers
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
19a590e114 mon/OSDMonitor: make_snap_key -> make_removed_snap_key, make_purged_snap_key
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
441f42b8ad mon/OSDMonitor: fix lookup_purged_snap implementation
- look at purged, not removed snap keys
- fix the key check to look at the *key name* prefix, not the overall
  prefix (the one implemented by the KeyValueDB interface).

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
a12d80a813 mon/OSDMonitor: lookup_pruned_snap -> lookup_purged_snap
This confused me and sent me into the weeds.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:50 -05:00
Sage Weil
94ebe0eab9 osd: adjust snapmapper keys on first start as octopus
Convert snapmapper keys to the new form the first time we start up running
octopus.

This is an incompat feature--once you start as octopus you can't go back.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00
Sage Weil
84bea65d3e osd/SnapMapper: include poolid in snap index
We want to sort starting with (pool, snapid, ...) so that we align with
the structure of the purged_snaps.  Simply flattening all snaps across
pools is less than ideal because the purge records are intervals (with the
snap in the key the last snap for the interval); flattening means we'd have
to look at many records (across pools) to conclude anything.  Putting
these in the form we really want them simplifies things going forward.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00
Sage Weil
14fdb52c50 mon/OSDMonitor: document osd snap metadata format
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00
Sage Weil
e8a359814c osd/SnapMapper: document stored keys and values
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00
Sage Weil
ec4cd08261 mon/OSDMonitor: use structured binding for prepare_remove_snaps
No functional change

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00
Sage Weil
e457b73075 mon/OSDMonitor: send MRemoveSnaps back to octopus MDS
The octopus MDS wants an explicit ack when snaps are removed.

Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00
Sage Weil
ab405ab560 mds/SnapServer: handle MRemoveSnaps acks from mon
Signed-off-by: Sage Weil <sage@redhat.com>
2019-07-02 08:37:49 -05:00