1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-22 23:21:53 +03:00

Pass ws_handle as const reference to provider replay()

This commit is contained in:
Teemu Ollakka
2018-06-19 09:36:15 +03:00
parent d1a1e298e9
commit 0e4c7f16a9
7 changed files with 9 additions and 10 deletions

View File

@ -38,8 +38,7 @@ enum wsrep::provider::status
db::client_service::replay()
{
wsrep::high_priority_context high_priority_context(client_state_);
auto ret(provider_.replay(const_cast<wsrep::ws_handle&>(
client_state_.transaction().ws_handle()),
auto ret(provider_.replay(client_state_.transaction().ws_handle(),
&client_state_));
if (ret == wsrep::provider::success)
{

View File

@ -268,7 +268,7 @@ namespace wsrep
* @return Zero in case of success, non-zero on failure.
*/
virtual enum status replay(
wsrep::ws_handle& ws_handle, void* applier_ctx) = 0;
const wsrep::ws_handle& ws_handle, void* applier_ctx) = 0;
virtual int sst_sent(const wsrep::gtid&, int) = 0;
virtual int sst_received(const wsrep::gtid&, int) = 0;

View File

@ -600,10 +600,10 @@ int wsrep::wsrep_provider_v26::release(wsrep::ws_handle& ws_handle)
}
enum wsrep::provider::status
wsrep::wsrep_provider_v26::replay(wsrep::ws_handle& ws_handle,
wsrep::wsrep_provider_v26::replay(const wsrep::ws_handle& ws_handle,
void* applier_ctx)
{
mutable_ws_handle mwsh(ws_handle);
const_ws_handle mwsh(ws_handle);
return map_return_value(
wsrep_->replay_trx(wsrep_, mwsh.native(), applier_ctx));
}

View File

@ -41,7 +41,7 @@ namespace wsrep
int commit_order_leave(const wsrep::ws_handle&,
const wsrep::ws_meta&);
int release(wsrep::ws_handle&);
enum wsrep::provider::status replay(wsrep::ws_handle&, void*);
enum wsrep::provider::status replay(const wsrep::ws_handle&, void*);
int sst_sent(const wsrep::gtid&,int);
int sst_received(const wsrep::gtid& gtid, int);

View File

@ -89,8 +89,7 @@ namespace wsrep
replay() WSREP_OVERRIDE
{
enum wsrep::provider::status ret(
provider_.replay(const_cast<wsrep::ws_handle&>(
client_state_.transaction().ws_handle()),
provider_.replay(client_state_.transaction().ws_handle(),
&client_state_));
++replays_;
return ret;

View File

@ -152,7 +152,8 @@ namespace wsrep
return release_result_;
}
enum wsrep::provider::status replay(wsrep::ws_handle&, void* ctx)
enum wsrep::provider::status replay(const wsrep::ws_handle&,
void* ctx)
{
wsrep::client_state& cc(
*static_cast<wsrep::client_state*>(ctx));