Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit bfd72af

Browse files
knizhnikkelvich
authored andcommitted
Handle critical errors (not completed)
1 parent 97a3e42 commit bfd72af

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

multimaster.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1014,6 +1014,23 @@ void MtmAbortTransaction(MtmTransState* ts)
10141014
* -------------------------------------------
10151015
*/
10161016

1017+
void MtmHandleApplyError(void)
1018+
{
1019+
ErrorData *edata = CopyErrorData();
1020+
switch (edata->sqlerrcode) {
1021+
case ERRCODE_DISK_FULL:
1022+
case ERRCODE_INSUFFICIENT_RESOURCES:
1023+
case ERRCODE_IO_ERROR:
1024+
case ERRCODE_DATA_CORRUPTED:
1025+
case ERRCODE_INDEX_CORRUPTED:
1026+
case ERRCODE_SYSTEM_ERROR:
1027+
case ERRCODE_INTERNAL_ERROR:
1028+
case ERRCODE_OUT_OF_MEMORY:
1029+
break;
1030+
}
1031+
}
1032+
1033+
10171034
void MtmRecoveryCompleted(void)
10181035
{
10191036
MTM_LOG1("Recovery of node %d is completed", MtmNodeId);

multimaster.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,5 +238,6 @@ extern void MtmCheckQuorum(void);
238238
extern bool MtmRecoveryCaughtUp(int nodeId, XLogRecPtr slotLSN);
239239
extern void MtmRecoveryCompleted(void);
240240
extern void MtmMakeTableLocal(char* schema, char* name);
241+
extern void MtmHandleApplyError(void);
241242

242243
#endif

pglogical_apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -951,6 +951,7 @@ void MtmExecutor(int id, void* work, size_t size)
951951
}
952952
PG_CATCH();
953953
{
954+
MtmHandleApplyError();
954955
EmitErrorReport();
955956
FlushErrorState();
956957
MTM_LOG2("%d: REMOTE begin abort transaction %d", MyProcPid, MtmGetCurrentTransactionId());

0 commit comments

Comments
 (0)