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

Commit e5ddfe0

Browse files
committed
use more resistant way of filtering inserts into mtm.referee_decision table
1 parent fc59935 commit e5ddfe0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

multimaster.c

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3819,13 +3819,25 @@ MtmReplicationTxnFilterHook(struct PGLogicalTxnFilterArgs* args)
38193819
return res;
38203820
}
38213821

3822-
/**
3822+
/*
38233823
* Filter record corresponding to local (non-distributed) tables
38243824
*/
38253825
static bool
38263826
MtmReplicationRowFilterHook(struct PGLogicalRowFilterArgs* args)
38273827
{
38283828
bool isDistributed;
3829+
3830+
/*
3831+
* We have several built-in local tables that shouldn't be replicated.
3832+
* It is hard to insert them into MtmLocalTables properly on extension
3833+
* creation so we just list them here.
3834+
*/
3835+
if (strcmp(args->changed_rel->rd_rel->relname.data, "referee_decision") == 0)
3836+
return false;
3837+
3838+
/*
3839+
* Check in shared hash of local tables.
3840+
*/
38293841
MtmLock(LW_SHARED);
38303842
if (!Mtm->localTablesHashLoaded) {
38313843
MtmUnlock();
@@ -3837,6 +3849,7 @@ MtmReplicationRowFilterHook(struct PGLogicalRowFilterArgs* args)
38373849
}
38383850
isDistributed = hash_search(MtmLocalTables, &RelationGetRelid(args->changed_rel), HASH_FIND, NULL) == NULL;
38393851
MtmUnlock();
3852+
38403853
return isDistributed;
38413854
}
38423855

state.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ MtmRefereeHasLocalTable()
612612

613613
if (OidIsValid(rel_oid))
614614
{
615-
MtmMakeRelationLocal(rel_oid);
615+
// MtmMakeRelationLocal(rel_oid);
616616
_has_local_tables = true;
617617
return true;
618618
}

0 commit comments

Comments
 (0)