1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-06-16 02:01:44 +03:00

Recover current view from state after SST.

When member joins the group and needs to receive an SST it won't
receive the corresponding menbership view event because the SST
happens after the event and will already include the effects of
all events ordered before it. The view then must be recovered from
the received state.

Minor renames and cleanups.

References codership/wsrep-lib#18
This commit is contained in:
Alexey Yurchenko
2018-11-11 21:59:24 +02:00
parent c7e8bfbdb5
commit fb14883547
12 changed files with 198 additions and 27 deletions

View File

@ -49,6 +49,48 @@ wsrep::provider* wsrep::provider::make_provider(
return 0;
}
std::string wsrep::provider::capability::str(int caps)
{
std::ostringstream os;
#define WSREP_PRINT_CAPABILITY(cap_value, cap_string) \
if (caps & cap_value) { \
os << cap_string ", "; \
caps &= ~cap_value; \
}
WSREP_PRINT_CAPABILITY(multi_master, "MULTI-MASTER");
WSREP_PRINT_CAPABILITY(certification, "CERTIFICATION");
WSREP_PRINT_CAPABILITY(parallel_applying, "PARALLEL_APPLYING");
WSREP_PRINT_CAPABILITY(transaction_replay, "REPLAY");
WSREP_PRINT_CAPABILITY(isolation, "ISOLATION");
WSREP_PRINT_CAPABILITY(pause, "PAUSE");
WSREP_PRINT_CAPABILITY(causal_reads, "CAUSAL_READ");
WSREP_PRINT_CAPABILITY(causal_transaction, "CAUSAL_TRX");
WSREP_PRINT_CAPABILITY(incremental_writeset, "INCREMENTAL_WS");
WSREP_PRINT_CAPABILITY(session_locks, "SESSION_LOCK");
WSREP_PRINT_CAPABILITY(distributed_locks, "DISTRIBUTED_LOCK");
WSREP_PRINT_CAPABILITY(consistency_check, "CONSISTENCY_CHECK");
WSREP_PRINT_CAPABILITY(unordered, "UNORDERED");
WSREP_PRINT_CAPABILITY(annotation, "ANNOTATION");
WSREP_PRINT_CAPABILITY(preordered, "PREORDERED");
WSREP_PRINT_CAPABILITY(streaming, "STREAMING");
WSREP_PRINT_CAPABILITY(snapshot, "SNAPSHOT");
WSREP_PRINT_CAPABILITY(nbo, "NBO");
#undef WSREP_PRINT_CAPABILITY
if (caps)
{
assert(caps == 0); // to catch missed capabilities
os << "UNKNOWN(" << caps << ") ";
}
std::string ret(os.str());
if (ret.size() > 2) ret.erase(ret.size() - 2);
return ret;
}
std::string wsrep::flags_to_string(int flags)
{
std::ostringstream oss;