41#define TC_LOG_MIN_PAGES 6
81 virtual int open(
const char *opt_name) = 0;
138 int open(
const char *)
override {
return 0; }
193 int open(
const char *opt_name)
override;
194 void close()
override;
230 assert(
p->ptr <
p->end);
234 ulong cookie = (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:68
void close() override
Close the transaction coordinator log and free any resources.
Definition: tc_log.h:139
int rollback(THD *thd, bool all) override
Log a rollback record of the transaction to the transaction coordinator log.
Definition: tc_log.cc:64
enum_result commit(THD *thd, bool all) override
Log a commit record of the transaction to the transaction coordinator log.
Definition: tc_log.cc:60
int open(const char *) override
Initialize and open the coordinator log.
Definition: tc_log.h:138
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:226
PAGE * get_active_from_pool()
there is no active page, let's got one from the pool.
Definition: tc_log.cc:232
enum_result commit(THD *thd, bool all) override
Commit the transaction.
Definition: tc_log.cc:292
PAGE * pages
Definition: tc_log.h:174
uint size() const
Get the total amount of potentially usable slots for XIDs in TC log.
Definition: tc_log.cc:212
my_off_t file_length
Definition: tc_log.h:171
bool wait_sync_completion(PAGE *p)
Wait for until page data will be written to the disk.
Definition: tc_log.h:250
PAGE * pool
Definition: tc_log.h:174
File fd
Definition: tc_log.h:170
void unlog(ulong cookie, my_xid xid)
erase xid from the page, update page free space counters/pointers.
Definition: tc_log.cc:432
void close() override
Close the transaction coordinator log and free any resources.
Definition: tc_log.cc:451
virtual int do_msync_and_fsync(int fd_arg, void *addr, size_t len, int flags)
Definition: tc_log.h:210
uchar * data
Definition: tc_log.h:173
uint npages
Definition: tc_log.h:172
mysql_mutex_t LOCK_tc
Definition: tc_log.h:179
PAGE * syncing
Definition: tc_log.h:174
char logname[FN_REFLEN]
Definition: tc_log.h:169
TC_LOG_MMAP()
Definition: tc_log.h:192
void overflow()
Definition: tc_log.cc:266
PAGE_STATE
Definition: tc_log.h:147
@ PS_DIRTY
Definition: tc_log.h:150
@ PS_POOL
Definition: tc_log.h:148
@ PS_ERROR
Definition: tc_log.h:149
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:189
friend class TCLogMMapTest
Definition: tc_log.h:264
PAGE ** pool_last_ptr
Definition: tc_log.h:174
int recover()
Definition: tc_log.cc:482
int open(const char *opt_name) override
Initialize and open the coordinator log.
Definition: tc_log.cc:119
PAGE * active
Definition: tc_log.h:174
uint inited
Definition: tc_log.h:172
ulong log_xid(my_xid xid)
Record that transaction XID is committed on the persistent storage.
Definition: tc_log.cc:344
mysql_cond_t COND_active
Signalled when active PAGE is moved to syncing state, thus member "active" becomes 0.
Definition: tc_log.h:184
int rollback(THD *thd, bool all) override
Log a rollback record of the transaction to the transaction coordinator log.
Definition: tc_log.cc:310
int prepare(THD *thd, bool all) override
Log a prepare record of the transaction to the storage engines.
Definition: tc_log.cc:314
bool sync()
Write the page data being synchronized to the disk.
Definition: tc_log.cc:397
Transaction Coordinator Log.
Definition: tc_log.h:54
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:526
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:70
@ RESULT_INCONSISTENT
Definition: tc_log.h:70
@ RESULT_SUCCESS
Definition: tc_log.h:70
@ RESULT_ABORTED
Definition: tc_log.h:70
For each client connection we create a separate thread with THD serving as a thread/connection descri...
Definition: sql_class.h:945
#define mysql_cond_wait(C, M)
Definition: mysql_cond.h:47
const char * p
Definition: ctype-mb.cc:1236
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.
Instrumentation helpers for conditions.
ulonglong my_xid
recover() step of xa.
Definition: handler.h:6995
PAGE * next
Definition: tc_log.h:155
my_xid * start
Definition: tc_log.h:156
int waiters
Definition: tc_log.h:159
my_xid * end
Definition: tc_log.h:156
int free
Definition: tc_log.h:158
PAGE_STATE state
Definition: tc_log.h:160
int size
Definition: tc_log.h:158
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:166
my_xid * ptr
Definition: tc_log.h:157
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:523
TC_LOG_MMAP tc_log_mmap
Definition: tc_log.cc:524
TC_LOG * tc_log
Definition: tc_log.cc:522
ulonglong my_xid
Definition: tc_log.h:37
unsigned int uint
Definition: uca-dump.cc:29
static int all(site_def const *s, node_no node)
Definition: xcom_transport.cc:868