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

Commit8dc7c33

Browse files
committed
Improve tablesync behavior with concurrent changes
When a table is removed from a subscription before the tablesync workercould start, this would previously result in an error when readingpg_subscription_rel. Now we just ignore this.Author: Masahiko Sawada <sawada.mshk@gmail.com>
1 parent76b11e8 commit8dc7c33

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

‎src/backend/replication/logical/tablesync.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
796796
StartTransactionCommand();
797797
relstate=GetSubscriptionRelState(MyLogicalRepWorker->subid,
798798
MyLogicalRepWorker->relid,
799-
&relstate_lsn,false);
799+
&relstate_lsn,true);
800800
CommitTransactionCommand();
801801

802802
SpinLockAcquire(&MyLogicalRepWorker->relmutex);
@@ -942,7 +942,10 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
942942
}
943943
caseSUBREL_STATE_SYNCDONE:
944944
caseSUBREL_STATE_READY:
945-
/* Nothing to do here but finish. */
945+
caseSUBREL_STATE_UNKNOWN:
946+
/* Nothing to do here but finish. (UNKNOWN means the relation was
947+
* removed from pg_subscription_rel before the sync worker could
948+
* start.) */
946949
finish_sync_worker();
947950
break;
948951
default:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp