| 1519 | } |
| 1520 | |
| 1521 | static void |
| 1522 | exec_mpp_dtx_protocol_command(DtxProtocolCommand dtxProtocolCommand, |
| 1523 | const char *loggingStr, |
| 1524 | const char *gid, |
| 1525 | DtxContextInfo *contextInfo) |
| 1526 | { |
| 1527 | QueryCompletion qc; |
| 1528 | CommandDest dest = whereToSendOutput; |
| 1529 | qc.commandTag = GetCommandTagEnum(loggingStr); |
| 1530 | qc.nprocessed = 1; |
| 1531 | |
| 1532 | SIMPLE_FAULT_INJECTOR("exec_dtx_protocol_start"); |
| 1533 | |
| 1534 | if (log_statement == LOGSTMT_ALL) |
| 1535 | elog(LOG,"DTM protocol command '%s' for gid = %s", loggingStr, gid); |
| 1536 | |
| 1537 | elog((Debug_print_full_dtm ? LOG : DEBUG5),"exec_mpp_dtx_protocol_command received the dtxProtocolCommand = %d (%s) gid = %s", |
| 1538 | dtxProtocolCommand, loggingStr, gid); |
| 1539 | |
| 1540 | set_ps_display(loggingStr); |
| 1541 | |
| 1542 | if (Debug_dtm_action == DEBUG_DTM_ACTION_FAIL_BEGIN_COMMAND && |
| 1543 | CheckDebugDtmActionProtocol(dtxProtocolCommand, contextInfo)) |
| 1544 | { |
| 1545 | ereport(ERROR, |
| 1546 | (errcode(ERRCODE_FAULT_INJECT), |
| 1547 | errmsg("Raise ERROR for debug_dtm_action = %d, debug_dtm_action_protocol = %s", |
| 1548 | Debug_dtm_action, DtxProtocolCommandToString(dtxProtocolCommand)))); |
| 1549 | } |
| 1550 | if (Debug_dtm_action == DEBUG_DTM_ACTION_PANIC_BEGIN_COMMAND && |
| 1551 | CheckDebugDtmActionProtocol(dtxProtocolCommand, contextInfo)) |
| 1552 | { |
| 1553 | /* |
| 1554 | * Avoid core file generation for this PANIC. It helps to avoid |
| 1555 | * filling up disks during tests and also saves time. |
| 1556 | */ |
| 1557 | AvoidCorefileGeneration(); |
| 1558 | elog(PANIC,"PANIC for debug_dtm_action = %d, debug_dtm_action_protocol = %s", |
| 1559 | Debug_dtm_action, DtxProtocolCommandToString(dtxProtocolCommand)); |
| 1560 | } |
| 1561 | |
| 1562 | BeginCommand(qc.commandTag, dest); |
| 1563 | |
| 1564 | performDtxProtocolCommand(dtxProtocolCommand, gid, contextInfo); |
| 1565 | |
| 1566 | elog((Debug_print_full_dtm ? LOG : DEBUG5),"exec_mpp_dtx_protocol_command calling EndCommand for dtxProtocolCommand = %d (%s) gid = %s", |
| 1567 | dtxProtocolCommand, loggingStr, gid); |
| 1568 | |
| 1569 | if (Debug_dtm_action == DEBUG_DTM_ACTION_FAIL_END_COMMAND && |
| 1570 | CheckDebugDtmActionProtocol(dtxProtocolCommand, contextInfo)) |
| 1571 | { |
| 1572 | ereport(ERROR, |
| 1573 | (errcode(ERRCODE_FAULT_INJECT), |
| 1574 | errmsg("Raise error for debug_dtm_action = %d, debug_dtm_action_protocol = %s", |
| 1575 | Debug_dtm_action, DtxProtocolCommandToString(dtxProtocolCommand)))); |
| 1576 | } |
| 1577 | |
| 1578 | /* |
no test coverage detected