Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitbfd72af

Browse files
knizhnikkelvich
authored andcommitted
Handle critical errors (not completed)
1 parent97a3e42 commitbfd72af

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+
voidMtmHandleApplyError(void)
1018+
{
1019+
ErrorData*edata=CopyErrorData();
1020+
switch (edata->sqlerrcode) {
1021+
caseERRCODE_DISK_FULL:
1022+
caseERRCODE_INSUFFICIENT_RESOURCES:
1023+
caseERRCODE_IO_ERROR:
1024+
caseERRCODE_DATA_CORRUPTED:
1025+
caseERRCODE_INDEX_CORRUPTED:
1026+
caseERRCODE_SYSTEM_ERROR:
1027+
caseERRCODE_INTERNAL_ERROR:
1028+
caseERRCODE_OUT_OF_MEMORY:
1029+
break;
1030+
}
1031+
}
1032+
1033+
10171034
voidMtmRecoveryCompleted(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
externboolMtmRecoveryCaughtUp(intnodeId,XLogRecPtrslotLSN);
239239
externvoidMtmRecoveryCompleted(void);
240240
externvoidMtmMakeTableLocal(char*schema,char*name);
241+
externvoidMtmHandleApplyError(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)

[8]ページ先頭

©2009-2025 Movatter.jp