In particular, don't use snap_trimq when manipulating
info.purged_snaps. Pass the resulting to_trim set
into on_activate.
Signed-off-by: Samuel Just <sjust@redhat.com>
PeeringState was the only remaining caller -- both the interface in
PGBackend and the pass-through in PrimaryLogPG were actually unused.
Further, the WaitLocalRecoveryReserved user does not appear to actually
require the fresh-off-of-the-wire osdmap available from OSDService.
As such, moved the logic into OSDMap itself and simply used the
PG local osdmap.
Note, the above is a change in behavior that probably could use a second
opinion.
Signed-off-by: Samuel Just <sjust@redhat.com>
Note: this patch only sets dirty_info/dirty_big_info when
info.purged_snaps is actually changed. I *think* that's
right, but that part deserves particular attention during
review.
Signed-off-by: Samuel Just <sjust@redhat.com>
This patch recasts the reservation and backoff interfaces
on PeeringListener in terms of events to queue rather than
explicit callbacks (PG handles implementing via callbacks).
Signed-off-by: Samuel Just <sjust@redhat.com>
As PeeringState won't be as careful about usage of
on_info_history_change, add a scrub_registered flag
to protect against double-(un)registers.
Signed-off-by: sjust@redhat.com <sjust@redhat.com>
This patch moves the 40 something peering state variables over into
PeeringState while leaving references to them in PG. The following
patches will move over the users until all users are in PeeringState.
Then, the PG references will be removed. A subsequent patch will also
move the recovery_state member to be the last initialize and first
destructed.
Signed-off-by: sjust@redhat.com <sjust@redhat.com>
I don't think there's any need to worry about the pg locking from
PGStateHistory. NamedState::begin/exit and dump_pgstate_history are the
only users, so the only calls should be under the peering event handler,
the asok command, or the PG constructor and destructor. The first two
already have the lock. The last should be safe as well as long as
the state machine states are constructed and destructed after and
before the PGStateHistory instance. As such, this patch removes most
of that state leaving the epoch generation as an interface
implemented by PG.
The snap trimming state machine was already excluded, so that this
patch leaves it disabled.
Signed-off-by: Samuel Just <sjust@redhat.com>
I'm going to extract this logic and reuse it in crimson. Recovery* has
always been a confusing name as it implements neither log-based recovery
nor backfill. Rather, it's mainly the buisiness logic for agreeing on
an authoritative log and some ancillary things such as scrub/backfill
reservation.
$ for i in $(git grep -l 'RecoveryMachine'); do sed -i 's/RecoveryMachine/PeeringMachine/g' $i; done
$ for i in $(git grep -l 'RecoveryState'); do sed -i 's/RecoveryState/PeeringState/g' $i; done
$ for i in $(git grep -l 'RecoveryCtx'); do sed -i 's/RecoveryCtx/PeeringCtx/g' $i; done
Signed-off-by: Samuel Just <sjust@redhat.com>
Just do what the error messages ask for.
Error from Clang:
```
In file included from /home/jenkins/workspace/ceph-master/src/cls/rbd/cls_rbd.cc:28:
In file included from /home/jenkins/workspace/ceph-master/src/objclass/../include/types.h:21:
In file included from /home/jenkins/workspace/ceph-master/src/include/uuid.h:9:
In file included from /home/jenkins/workspace/ceph-master/src/include/encoding.h:17:
In file included from /usr/include/c++/v1/set:426:
In file included from /usr/include/c++/v1/__tree:16:
/usr/include/c++/v1/memory:2241:41: error: call to implicitly-deleted default constructor of '__compressed_pair_elem<ceph::BitVector<'\x02'>::NoInitAllocator, 1>'
: _Base1(std::forward<_Tp>(__t)), _Base2() {}
^
/usr/include/c++/v1/vector:437:7: note: in instantiation of function template specialization 'std::__1::__compressed_pair<unsigned int *, ceph::BitVector<'\x02'>::NoInitAllocator>::__compressed_pair<nullptr_t, true>' requested here
__end_cap_(nullptr)
^
/usr/include/c++/v1/vector:496:5: note: in instantiation of member function 'std::__1::__vector_base<unsigned int, ceph::BitVector<'\x02'>::NoInitAllocator>::__vector_base' requested here
vector() _NOEXCEPT_(is_nothrow_default_constructible<allocator_type>::value)
^
/home/jenkins/workspace/ceph-master/src/common/bit_vector.hpp:163:3: note: in instantiation of member function 'std::__1::vector<unsigned int, ceph::BitVector<'\x02'>::NoInitAllocator>::vector' requested here
BitVector();
^
/home/jenkins/workspace/ceph-master/src/cls/rbd/cls_rbd.cc:3289:16: note: in instantiation of member function 'ceph::BitVector<'\x02'>::BitVector' requested here
BitVector<2> object_map;
^
/usr/include/c++/v1/memory:2179:39: note: explicitly defaulted function was implicitly deleted here
_LIBCPP_INLINE_VISIBILITY constexpr __compressed_pair_elem() = default;
^
/usr/include/c++/v1/memory:2172:50: note: default constructor of '__compressed_pair_elem<ceph::BitVector<'\x02'>::NoInitAllocator, 1, true>' is implicitly deleted because base class 'ceph::BitVector<'\x02'>::NoInitAllocator' has no default constructor
struct __compressed_pair_elem<_Tp, _Idx, true> : private _Tp {
^
1 error generated.
```
Fixes: http://tracker.ceph.com/issues/39561
Signed-off-by: Willem Jan Withagen <wjw@digiware.nl>
So that both vi and emacs help to correctly format the source files,
add the directives to each of the source files. In addition, use
`#pragma once` in the header files instead of the macro work-around.
Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>