Does "XA prepare log record" also trigger logbuffer flush, similar to COMMIT?

Rui Chen

Does "XA prepare log record" also trigger logbuffer flush, similar to COMMIT?

Hi there,

I'm trying to understand how/if "indoubt transaction record" ("XA prepare log record" in KC ref. link), could ALWAYS survive db2 restart or forced HADR takeover.

This would be a trivial question, if the XAPrepare record is always flushed to disk first, before the XAPrepare call is considered completed (similar to normal COMMIT), which should probably be true considering DB2 supports XA (otherwise "XAResource # recover()" might not be able to return a complete list of Xid).... But i haven't been able to find much reference on this topic, and hope our experts could share some insight :)

 

Assuming XAPrepare log record always flushed to disk first, it implies (NEAR)SYNC HADR 2PC needs two round trip between primary and standby.... hmmmmm

 

Btw, we use LUW V10.5FP8, in a single node env. 

Thanks for your input!

Edited By:
Rui Chen[Organization Members] @ Jul 02, 2018 - 11:38 AM (America/Eastern)
Rui Chen[Organization Members] @ Jul 02, 2018 - 03:30 PM (America/Eastern)

Rui Chen

RE: Does "XA prepare log record" also trigger logbuffer flush, similar to COMMIT?
(in response to Rui Chen)

the closest answer i've found so far is in "XA spec, section 3.4 'Branch completion'", stating:

"

A TM calls xa_prepare() to ask the RM to prepare to commit a transaction branch. The RM places any resources it holds in a state such that it can either make any changes permanent if the TM subsequently calls xa_commit(), or nullify any changes if the TM calls xa_rollback(). An affirmative return from xa_prepare() guarantees that a subsequent xa_commit() or xa_rollback() succeeds, even if the RM experiences a failure after responding to xa_prepare().

"

download URL to "XA Spec": http://pubs.opengroup.org/onlinepubs/009680699/toc.pdf