diff options
Diffstat (limited to 'sql/wsrep_binlog.h')
-rw-r--r-- | sql/wsrep_binlog.h | 61 |
1 files changed, 53 insertions, 8 deletions
diff --git a/sql/wsrep_binlog.h b/sql/wsrep_binlog.h index ed8e19ed651..252fbe602d2 100644 --- a/sql/wsrep_binlog.h +++ b/sql/wsrep_binlog.h @@ -16,6 +16,7 @@ #ifndef WSREP_BINLOG_H #define WSREP_BINLOG_H +#include "my_global.h" #include "sql_class.h" // THD, IO_CACHE #define HEAP_PAGE_SIZE 65536 /* 64K */ @@ -38,21 +39,65 @@ int wsrep_write_cache_buf(IO_CACHE *cache, uchar **buf, size_t *buf_len); @param len total amount of data written @return wsrep error status */ -int wsrep_write_cache (wsrep_t* const wsrep, - THD* const thd, - IO_CACHE* const cache, - size_t* const len); +int wsrep_write_cache(THD* thd, + IO_CACHE* cache, + size_t* len); /* Dump replication buffer to disk */ void wsrep_dump_rbr_buf(THD *thd, const void* rbr_buf, size_t buf_len); -/* Dump replication buffer to disk without intermediate buffer */ -void wsrep_dump_rbr_direct(THD* thd, IO_CACHE* cache); - /* Dump replication buffer along with header to a file */ void wsrep_dump_rbr_buf_with_header(THD *thd, const void *rbr_buf, size_t buf_len); -int wsrep_binlog_close_connection(THD* thd); +/** + Write a skip event into binlog. + + @param thd Thread object pointer + @return Zero in case of success, non-zero on failure. +*/ +int wsrep_write_skip_event(THD* thd); + +/* + Write dummy event into binlog in place of unused GTID. + The binlog write is done in thd context. +*/ +int wsrep_write_dummy_event_low(THD *thd, const char *msg); +/* + Write dummy event to binlog in place of unused GTID and + commit. The binlog write and commit are done in temporary + thd context, the original thd state is not altered. +*/ +int wsrep_write_dummy_event(THD* thd, const char *msg); + +void wsrep_register_binlog_handler(THD *thd, bool trx); + +/** + Return true if committing THD will write to binlog during commit. + This is the case for: + - Local THD, binlog is open + - Replaying THD, binlog is open + - Applier THD, log-slave-updates is enabled +*/ +bool wsrep_commit_will_write_binlog(THD *thd); + +/** + Register THD for group commit. The wsrep_trx must be in committing state, + i.e. the call must be done after wsrep_before_commit() but before + commit order is released. + + This call will release commit order critical section if it is + determined that the commit will go through binlog group commit. + */ +void wsrep_register_for_group_commit(THD *thd); + +/** + Deregister THD from group commit. The wsrep_trx must be in committing state, + as for wsrep_register_for_group_commit() above. + + This call must be used only for THDs which will not go through + binlog group commit. +*/ +void wsrep_unregister_from_group_commit(THD *thd); #endif /* WSREP_BINLOG_H */ |