1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-06 20:56:43 +03:00
Files
wsrep-lib/src/wsrep_provider_v26.hpp
Teemu Ollakka 41fee48c9e Squashed commit of the following:
commit 3b419aa6e2
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Sun Feb 19 10:29:34 2023 +0200

    Skip fetching config options if provider not loaded via wsrep-API

commit 044220cc06
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Wed Jul 13 10:31:03 2022 +0300

    Operation context pointer for client state

commit eeb05a9238
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Mon Jul 4 09:03:23 2022 +0300

    Add unit test log in gitignore

commit 92a04070fc
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Sun May 8 12:45:36 2022 +0300

    Added convenience method prev() to seqno

commit f83ca1917e
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Sun May 1 16:37:24 2022 +0300

    Pass victim context for provider on BF abort

    This change is needed for custom provider implementations to
    have a way to access the victim in the application context.

    Helper interface operation_context to pass caller context for
    service/provider callbacks in more type safe way.

commit 244eabe8cf
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Wed May 25 07:39:43 2022 +0300

    Handle disconnecting state in on_sync()

    When disconnecting from the group, the sync event from the
    provider must not change the state back to synced.

commit ba8e23df0d
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Tue Mar 22 17:43:52 2022 +0200

    Add provider position field to ws_meta and view

    Provider position is needed in coordinated recovery
    between application and provider. Pass the position
    info from provider to application to allow making
    it durable.

commit 53e60f64c9
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Sat Mar 19 14:45:57 2022 +0200

    Reset TOI meta after releasing total order in provider

    This is to keep the TOI meta available in case the provider
    implementation needs it.

commit bccb9997f2
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Mon Jan 3 11:19:58 2022 +0200

    Fixed id ostream operator to print human readable ids

commit 6d0b37daaf
Author: Teemu Ollakka <teemu.ollakka@galeracluster.com>
Date:   Wed Dec 15 16:37:45 2021 +0200

    Silence unused variable warning

commit 4b8616f3d1
Author: Denis Protivensky <denis.protivensky@galeracluster.com>
Date:   Wed Dec 15 16:43:31 2021 +0300

    Fix provider loading in test for release builds

commit 6df17812d9
Author: Denis Protivensky <denis.protivensky@galeracluster.com>
Date:   Tue Dec 14 20:28:56 2021 +0300

    Introduce set_provider_factory() method for server_state

    This allows injecting an application allocated provider into
    server_state.

    After this virtual provider getter is unnecessary. Made the getter
    normal method and fixed unit tests accordingly.
2024-03-09 12:16:42 +02:00

119 lines
5.0 KiB
C++

/*
* Copyright (C) 2018 Codership Oy <info@codership.com>
*
* This file is part of wsrep-lib.
*
* Wsrep-lib is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 2 of the License, or
* (at your option) any later version.
*
* Wsrep-lib is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with wsrep-lib. If not, see <https://www.gnu.org/licenses/>.
*/
#ifndef WSREP_WSREP_PROVIDER_V26_HPP
#define WSREP_WSREP_PROVIDER_V26_HPP
#include "wsrep/provider.hpp"
struct wsrep_st;
namespace wsrep
{
class thread_service;
class wsrep_provider_v26 : public wsrep::provider
{
public:
void init_services(const wsrep::provider::services& services);
void deinit_services();
wsrep_provider_v26(wsrep::server_state&, const std::string&,
const std::string&,
const wsrep::provider::services& services);
~wsrep_provider_v26() WSREP_OVERRIDE;
enum wsrep::provider::status
connect(const std::string&, const std::string&, const std::string&,
bool) WSREP_OVERRIDE;
int disconnect() WSREP_OVERRIDE;
int capabilities() const WSREP_OVERRIDE;
int desync() WSREP_OVERRIDE;
int resync() WSREP_OVERRIDE;
wsrep::seqno pause() WSREP_OVERRIDE;
int resume() WSREP_OVERRIDE;
enum wsrep::provider::status
run_applier(wsrep::high_priority_service*) WSREP_OVERRIDE;
int start_transaction(wsrep::ws_handle&) WSREP_OVERRIDE { return 0; }
enum wsrep::provider::status
assign_read_view(wsrep::ws_handle&, const wsrep::gtid*) WSREP_OVERRIDE;
int append_key(wsrep::ws_handle&, const wsrep::key&) WSREP_OVERRIDE;
enum wsrep::provider::status
append_data(wsrep::ws_handle&, const wsrep::const_buffer&)
WSREP_OVERRIDE;
enum wsrep::provider::status
certify(wsrep::client_id, wsrep::ws_handle&,
int,
wsrep::ws_meta&) WSREP_OVERRIDE;
enum wsrep::provider::status
bf_abort(wsrep::seqno,
wsrep::transaction_id,
wsrep::operation_context&,
wsrep::seqno&) WSREP_OVERRIDE;
enum wsrep::provider::status
rollback(const wsrep::transaction_id) WSREP_OVERRIDE;
enum wsrep::provider::status
commit_order_enter(const wsrep::ws_handle&,
const wsrep::ws_meta&) WSREP_OVERRIDE;
int commit_order_leave(const wsrep::ws_handle&,
const wsrep::ws_meta&,
const wsrep::mutable_buffer&) WSREP_OVERRIDE;
int release(wsrep::ws_handle&) WSREP_OVERRIDE;
enum wsrep::provider::status replay(const wsrep::ws_handle&,
wsrep::high_priority_service*)
WSREP_OVERRIDE;
enum wsrep::provider::status enter_toi(wsrep::client_id,
const wsrep::key_array&,
const wsrep::const_buffer&,
wsrep::ws_meta&,
int)
WSREP_OVERRIDE;
enum wsrep::provider::status leave_toi(wsrep::client_id,
const wsrep::ws_meta& ws_meta,
const wsrep::mutable_buffer&)
WSREP_OVERRIDE;
std::pair<wsrep::gtid, enum wsrep::provider::status>
causal_read(int) const WSREP_OVERRIDE;
enum wsrep::provider::status wait_for_gtid(const wsrep::gtid&, int)
const WSREP_OVERRIDE;
wsrep::gtid last_committed_gtid() const WSREP_OVERRIDE;
enum wsrep::provider::status sst_sent(const wsrep::gtid&, int)
WSREP_OVERRIDE;
enum wsrep::provider::status sst_received(const wsrep::gtid& gtid, int)
WSREP_OVERRIDE;
enum wsrep::provider::status enc_set_key(const wsrep::const_buffer& key)
WSREP_OVERRIDE;
std::vector<status_variable> status() const WSREP_OVERRIDE;
void reset_status() WSREP_OVERRIDE;
std::string options() const WSREP_OVERRIDE;
enum wsrep::provider::status options(const std::string&) WSREP_OVERRIDE;
std::string name() const WSREP_OVERRIDE;
std::string version() const WSREP_OVERRIDE;
std::string vendor() const WSREP_OVERRIDE;
void* native() const WSREP_OVERRIDE;
private:
wsrep_provider_v26(const wsrep_provider_v26&);
wsrep_provider_v26& operator=(const wsrep_provider_v26);
struct wsrep_st* wsrep_;
services services_enabled_;
};
}
#endif // WSREP_WSREP_PROVIDER_V26_HPP