mirror of
https://github.com/codership/wsrep-lib.git
synced 2025-04-27 18:56:49 +03:00
SR tranasctions are BF aborted or rolled back on primary view changes according to the following rules: * Ongoing local SR transactions are BF aborted if the processing server is not found from the current view. * All remote SR transactions whose origin server is not included in the current view are rolled back.
41 lines
835 B
C++
41 lines
835 B
C++
//
|
|
// Copyright (C) 2018 Codership Oy <info@codership.com>
|
|
//
|
|
|
|
#ifndef WSREP_CLIENT_ID_HPP
|
|
#define WSREP_CLIENT_ID_HPP
|
|
|
|
#include <ostream>
|
|
|
|
namespace wsrep
|
|
{
|
|
class client_id
|
|
{
|
|
public:
|
|
typedef unsigned long long type;
|
|
client_id()
|
|
: id_(-1)
|
|
{ }
|
|
template <typename I>
|
|
explicit client_id(I id)
|
|
: id_(static_cast<type>(id))
|
|
{ }
|
|
type get() const { return id_; }
|
|
static type undefined() { return -1; }
|
|
bool operator<(const client_id& other) const
|
|
{
|
|
return (id_ < other.id_);
|
|
}
|
|
private:
|
|
type id_;
|
|
};
|
|
static inline std::ostream& operator<<(
|
|
std::ostream& os, const wsrep::client_id& client_id)
|
|
{
|
|
return (os << client_id.get());
|
|
}
|
|
}
|
|
|
|
|
|
#endif // WSREP_CLIENT_ID_HPP
|