diff options
author | John Spray <john.spray@redhat.com> | 2017-02-08 17:24:24 +0100 |
---|---|---|
committer | John Spray <john.spray@redhat.com> | 2017-03-08 11:26:59 +0100 |
commit | 0952ce99101aad644e8a485f597c6428bfa2d2c0 (patch) | |
tree | aad34eaba820c8838c9d0adac637c1a8607d80c7 /src/mds/PurgeQueue.h | |
parent | mds: update PurgeQueue for single-ack OSD change (diff) | |
download | ceph-0952ce99101aad644e8a485f597c6428bfa2d2c0.tar.xz ceph-0952ce99101aad644e8a485f597c6428bfa2d2c0.zip |
mds: expose progress during PurgeQueue drain
We don't track an item count, but we do have
a number of bytes left in the Journaler, so
can use that to give an indication of progress
while the MDS rank shutdown is waiting for
the PurgeQueue to do its thing.
Also lift the ops limit on the PurgeQueue
when it goes into the drain phase.
Signed-off-by: John Spray <john.spray@redhat.com>
Diffstat (limited to 'src/mds/PurgeQueue.h')
-rw-r--r-- | src/mds/PurgeQueue.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mds/PurgeQueue.h b/src/mds/PurgeQueue.h index b235536745b..e86833d882e 100644 --- a/src/mds/PurgeQueue.h +++ b/src/mds/PurgeQueue.h @@ -103,6 +103,13 @@ protected: bool can_consume(); + // How many bytes were remaining when drain() was first called, + // used for indicating progress. + uint64_t drain_initial; + + // Has drain() ever been called on this instance? + bool draining; + void _consume(); void _execute_item( @@ -131,6 +138,22 @@ public: // anything. bool is_idle() const; + /** + * Signal to the PurgeQueue that you would like it to hurry up and + * finish consuming everything in the queue. Provides progress + * feedback. + * + * @param progress: bytes consumed since we started draining + * @param progress_total: max bytes that were outstanding during purge + * @param in_flight_count: number of file purges currently in flight + * + * @returns true if drain is complete + */ + bool drain( + uint64_t *progress, + uint64_t *progress_total, + size_t *in_flight_count); + void update_op_limit(const MDSMap &mds_map); void handle_conf_change(const struct md_config_t *conf, |