| 1985 | } |
| 1986 | |
| 1987 | void |
| 1988 | finishDistributedTransactionContext(char *debugCaller, bool aborted) |
| 1989 | { |
| 1990 | DistributedTransactionId gxid; |
| 1991 | |
| 1992 | /* |
| 1993 | * We let the 2 retry states go up to PostgresMain.c, otherwise everything |
| 1994 | * MUST be complete. |
| 1995 | */ |
| 1996 | if (isCurrentDtxActivated() && |
| 1997 | (MyTmGxactLocal->state != DTX_STATE_RETRY_COMMIT_PREPARED && |
| 1998 | MyTmGxactLocal->state != DTX_STATE_RETRY_ABORT_PREPARED)) |
| 1999 | { |
| 2000 | ereport(FATAL, |
| 2001 | (errmsg("Unexpected dtx status (caller = %s).", debugCaller), |
| 2002 | TM_ERRDETAIL)); |
| 2003 | } |
| 2004 | |
| 2005 | gxid = getDistributedTransactionId(); |
| 2006 | elog(DTM_DEBUG5, |
| 2007 | "finishDistributedTransactionContext called to change DistributedTransactionContext from %s to %s (caller = %s, gxid = "UINT64_FORMAT")", |
| 2008 | DtxContextToString(DistributedTransactionContext), |
| 2009 | DtxContextToString(DTX_CONTEXT_LOCAL_ONLY), |
| 2010 | debugCaller, |
| 2011 | gxid); |
| 2012 | |
| 2013 | setDistributedTransactionContext(DTX_CONTEXT_LOCAL_ONLY); |
| 2014 | |
| 2015 | DtxContextInfo_Reset(&QEDtxContextInfo); |
| 2016 | |
| 2017 | } |
| 2018 | |
| 2019 | static void |
| 2020 | rememberDtxExplicitBegin(void) |
no test coverage detected