Bug fix in the way crush_type is extracted from osd crush dump

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
While generating crush_types, avoiding item parsing, and calculating type count by just iterating thorugh buckets list

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
Fetching the date from ceph osd dump as that is more reliable across ceph versions

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
Included the total cluster size in components_count object

Signed-off-by: Babu Shanmugam <anbu@enovance.com>
Merge branch 'master' of https://github.com/enovance/ceph-brag into firefly
buffer: use Mutex instead of Spinlock for raw crcs

Signed-off-by: Sage Weil <sage@inktank.com>
ReplicatedPG::_rollback_to: fix comment, clone certainly could be missing

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::cancel_flush: requeue dup_ops even if !op

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::agent_work: skip if head is missing

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::finish_promote: soid.clone may have been trimed, fix assert

Signed-off-by: Samuel Just <sam.just@inktank.com>
ReplicatedPG::process_copy_chunk: don't check snaps if we got head

Even if we are promoting a clone, we may be reading from head.

Signed-off-by: Samuel Just <sam.just@inktank.com>
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>
Merge pull request #1696 from ceph/wip-8097

buffer: use Mutex instead of Spinlock for raw crcs

Reviewed-by: Samuel Just <sam.just@inktank.com>
buffer: adjust #include order

The pthread.h include is somehow clobbering things, although it is not
clear how.  :(

Signed-off-by: Sage Weil <sage@inktank.com>
ReplicatedPG::hit_set_persist: clean up degraded check

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd: track the number of hit_set archive objects in a pg

Also, use this value in agent_choose_mode instead of the max
number.

Related: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>
ECMsgTypes::ECSubWrite: fix at_version indentation

Signed-off-by: Samuel Just <sam.just@inktank.com>
encoding: use unqualified name for encode/decode in boost::optional encoding

Signed-off-by: Samuel Just <sam.just@inktank.com>
osd/: propogate hit_set history with repop

We don't actually send the whole info on each repop, just the log
entries, updated stats, and a few other bits.  For hit_set ops, we need
to also communicate the new hit_set history status atomically with the
log entries and the transaction.  Thus, we add a channel for an optional
pg_hit_set_history_t field in PGBackend::submit_transaction interface
and associated messages and implementations to update the hit_set info
field along with the log entries.

This also means that hit_set_(persist|trim) update an
updated_hit_set_history field on the OpContext instead of directly
modifying the info field.

Fixes: #8124
Signed-off-by: Samuel Just <sam.just@inktank.com>
PG,PGLog: update hit_set during peering

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