41#define TC_LOG_MIN_PAGES 6
85 bool run_after_commit =
true);
170 virtual int open(
const char *opt_name) = 0;
227 int open(
const char *)
override;
282 int open(
const char *opt_name)
override;
283 void close()
override;
319 assert(
p->ptr <
p->end);
324 (ulong)((
uchar *)
p->ptr - data_arg);
int prepare(THD *thd, bool all) override
Log a prepare record of the transaction to the storage engines.
Definition: tc_log.cc:260
void close() override
Close the transaction coordinator log and free any resources.
Definition: tc_log.h:228
int rollback(THD *thd, bool all) override
Log a rollback record of the transaction to the transaction coordinator log.
Definition: tc_log.cc:253
enum_result commit(THD *thd, bool all) override
Log a commit record of the transaction to the transaction coordinator log.
Definition: tc_log.cc:245
int open(const char *) override
Initialize and open the coordinator log.
Definition: tc_log.cc:237
ulong store_xid_in_empty_slot(my_xid xid, PAGE *p, uchar *data_arg)
Find empty slot in the page and write xid value there.
Definition: tc_log.h:315
PAGE * get_active_from_pool()
there is no active page, let's got one from the pool.
Definition: tc_log.cc:433
enum_result commit(THD *thd, bool all) override
Commit the transaction.
Definition: tc_log.cc:493
PAGE * pages
Definition: tc_log.h:263
uint size() const
Get the total amount of potentially usable slots for XIDs in TC log.
Definition: tc_log.cc:413
my_off_t file_length
Definition: tc_log.h:260
bool wait_sync_completion(PAGE *p)
Wait for until page data will be written to the disk.
Definition: tc_log.h:340
PAGE * pool
Definition: tc_log.h:263
File fd
Definition: tc_log.h:259
void unlog(ulong cookie, my_xid xid)
erase xid from the page, update page free space counters/pointers.
Definition: tc_log.cc:645
void close() override
Close the transaction coordinator log and free any resources.
Definition: tc_log.cc:664
virtual int do_msync_and_fsync(int fd_arg, void *addr, size_t len, int flags)
Definition: tc_log.h:299
uchar * data
Definition: tc_log.h:262
uint npages
Definition: tc_log.h:261
mysql_mutex_t LOCK_tc
Definition: tc_log.h:268
PAGE * syncing
Definition: tc_log.h:263
char logname[FN_REFLEN]
Definition: tc_log.h:258
TC_LOG_MMAP()
Definition: tc_log.h:281
void overflow()
Definition: tc_log.cc:467
PAGE_STATE
Definition: tc_log.h:236
@ PS_DIRTY
Definition: tc_log.h:239
@ PS_POOL
Definition: tc_log.h:237
@ PS_ERROR
Definition: tc_log.h:238
mysql_cond_t COND_pool
Signalled when one more page becomes available in the pool which we might select as active.
Definition: tc_log.h:278
friend class TCLogMMapTest
Definition: tc_log.h:354
PAGE ** pool_last_ptr
Definition: tc_log.h:263
int recover()
Definition: tc_log.cc:695
int open(const char *opt_name) override
Initialize and open the coordinator log.
Definition: tc_log.cc:315
PAGE * active
Definition: tc_log.h:263
uint inited
Definition: tc_log.h:261
ulong log_xid(my_xid xid)
Record that transaction XID is committed on the persistent storage.
Definition: tc_log.cc:557
mysql_cond_t COND_active
Signalled when active PAGE is moved to syncing state, thus member "active" becomes 0.
Definition: tc_log.h:273
int rollback(THD *thd, bool all) override
Log a rollback record of the transaction to the transaction coordinator log.
Definition: tc_log.cc:516
int prepare(THD *thd, bool all) override
Log a prepare record of the transaction to the storage engines.
Definition: tc_log.cc:523
bool sync()
Write the page data being synchronized to the disk.
Definition: tc_log.cc:610
Transaction Coordinator Log.
Definition: tc_log.h:143
virtual int open(const char *opt_name)=0
Initialize and open the coordinator log.
virtual enum_result commit(THD *thd, bool all)=0
Log a commit record of the transaction to the transaction coordinator log.
virtual ~TC_LOG()=default
bool using_heuristic_recover()
Perform heuristic recovery, if –tc-heuristic-recover was used.
Definition: tc_log.cc:739
virtual void close()=0
Close the transaction coordinator log and free any resources.
virtual int prepare(THD *thd, bool all)=0
Log a prepare record of the transaction to the storage engines.
virtual int rollback(THD *thd, bool all)=0
Log a rollback record of the transaction to the transaction coordinator log.
enum_result
Definition: tc_log.h:159
@ RESULT_INCONSISTENT
Definition: tc_log.h:159
@ RESULT_SUCCESS
Definition: tc_log.h:159
@ RESULT_ABORTED
Definition: tc_log.h:159
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_lexer_thd.h:33
#define mysql_cond_wait(C, M)
Definition: mysql_cond.h:47
const char * p
Definition: ctype-mb.cc:1234
int my_msync(int, void *, size_t, int)
Definition: my_mmap.cc:50
static int flags[50]
Definition: hp_test1.cc:39
Some integer typedefs for easier portability.
unsigned long long int ulonglong
Definition: my_inttypes.h:55
ulonglong my_off_t
Definition: my_inttypes.h:71
unsigned char uchar
Definition: my_inttypes.h:51
Common #defines and includes for file and socket I/O.
#define FN_REFLEN
Definition: my_io.h:82
int File
Definition: my_io_bits.h:50
Common header for many mysys elements.
Instrumentation helpers for conditions.
ABI for instrumented mutexes.
bool commit_detached_by_xid(THD *thd, bool run_after_commit=true)
Commits detached XA transaction by XID in all storage engines.
Definition: tc_log.cc:108
bool commit_in_engines(THD *thd, bool all=false, bool run_after_commit=true)
Commits the underlying transaction in storage engines.
Definition: tc_log.cc:136
bool should_statement_set_prepared_in_tc(THD *thd)
Checks whether or not the underlying statement should trigger setting the transaction to PREPARED_IN_...
Definition: tc_log.cc:179
int set_prepared_in_tc_in_engines(THD *thd, bool all=false)
Marks the underlying transaction as PREPARED_IN_TC in storage engines.
Definition: tc_log.cc:161
bool rollback_detached_by_xid(THD *thd)
Rolls back detached XA transaction by XID in all storage engines.
Definition: tc_log.cc:126
bool rollback_in_engines(THD *thd, bool all=false)
Rolls back the underlying transaction in storage engines.
Definition: tc_log.cc:149
Instrumentation helpers for conditions.
ulonglong my_xid
Definition: handler.h:1227
PAGE * next
Definition: tc_log.h:244
my_xid * start
Definition: tc_log.h:245
int waiters
Definition: tc_log.h:248
my_xid * end
Definition: tc_log.h:245
int free
Definition: tc_log.h:247
PAGE_STATE state
Definition: tc_log.h:249
int size
Definition: tc_log.h:247
mysql_cond_t cond
Signalled when syncing of this page is done or when this page is in "active" slot and syncing slot ju...
Definition: tc_log.h:255
my_xid * ptr
Definition: tc_log.h:246
An instrumented cond structure.
Definition: mysql_cond_bits.h:49
An instrumented mutex structure.
Definition: mysql_mutex_bits.h:49
TC_LOG_DUMMY tc_log_dummy
Definition: tc_log.cc:736
TC_LOG_MMAP tc_log_mmap
Definition: tc_log.cc:737
TC_LOG * tc_log
Definition: tc_log.cc:735
ulonglong my_xid
Definition: tc_log.h:37