PG: always clear_primary_state when leaving Primary

Otherwise, entries from the log collection process might leak into the next
epoch, where we might end up choosing a different authoritative log.  In this
case, it resulted in us not rolling back to log entries on one of the replicas
prior to trying to recover from an affected object due to the peer_missing not
being cleared.

Fixes: #10059
Backport: giant, firefly, dumpling
Signed-off-by: Samuel Just <sjust@redhat.com>
mon: PaxosService: can be readable even if proposing

As long as we have a stable version in memory that is lower or equal to
the version we want.

Fixes: #9321
Fixes: #9322

Signed-off-by: Joao Eduardo Luis <joao@redhat.com>
PG: always clear_primary_state on new interval, but only clear pg temp if not primary

Signed-off-by: Samuel Just <sjust@redhat.com>
PGLog: include rollback_info_trimmed_to in (read|write)_log

Fixes: #10157
Backport: firefly, giant
Signed-off-by: Samuel Just <sjust@redhat.com>
check endpoints is not empty before use it.

Signed-off-by: VRan Liu <gliuwr@gmail.com>
mon: fix MDS health status from peons

The health data was there, but we were attempting
to enumerate MDS GIDs from pending_mdsmap (empty on
peons) instead of mdsmap (populated from paxos updates)

Fixes: #10151
Backport: giant

Signed-off-by: John Spray <john.spray@redhat.com>
Merge pull request #2996 from ceph/wip-10151

mon: fix MDS health status from peons

Reviewed-by: Greg Farnum <gfarnum@redhat.com>
erasure-code: conditionally build jerasure sse3/sse4 plugins
autotools: ARM/AArch64 NEON detection similar to x86
aarch64: add support for HW_CAP based neon runtime detection
erasure-code: gf-complete use neon enabled branch

Signed-off-by: Loic Dachary <ldachary@redhat.com>
erasure-code: build and use a NEON jerasure variant
erasure-code: always compile SSE and NEON tests

They do not actually depend on CPU features and are required to validate
the plugin selection logic.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
erasure-code: include new headers in distribution

The NEON optimization introduced new headers that must be listed
explicitly to be included in tarbals.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
erasure-code: test NEON arch selection logic

The jerasure plugin loads the plugin that matches the architecture
supported by the CPU at runtime. Include the NEON plugin in the tests.

Signed-off-by: Loic Dachary <ldachary@redhat.com>
mon: OSDMonitor: allow adding tiers to FS pools

This was an overly-strict check.  In fact it is perfectly
fine to set an overlay on a pool that is already in use
as a filesystem data or metadata pool.

Fixes: #10135

Signed-off-by: John Spray <john.spray@redhat.com>
safe_io: do not set ending \0 in safe_read_file()

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
AsyncMessenger: Async event threads shared by all AsyncMessenger

WorkerPool is a singleton class which is served to AsyncMessenger. All
AsyncMessenger used the same worker pool.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
AsyncConnection: Ensure "mark_down" complete when returned

Now AsyncConnection try to process or modify any own variables within self
thread. It means actual function will be called by event loop not external.
So we can avoid lockdep or unnecessary lock for AsyncConnection.

So "mark_down" should be returned after _stop completed and all events has
be processed.

"external" for unregister_conn is unnecessary, because the caller won't
own AsyncMessenger::Lock again.

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>
AsyncConnection: Introduce "signal" event

Ensure signal cond after all previous events has be done

Signed-off-by: Haomai Wang <haomaiwang@gmail.com>