extern void bdr_launch_apply_workers(Oid dboid);
+extern Datum bdr_connections_changed(PG_FUNCTION_ARGS);
+
/* Information functions */
extern int bdr_parse_version(const char * bdr_version_str, int *o_major,
int *o_minor, int *o_rev, int *o_subrev);
bool *perform_update, bool *log_update,
BdrConflictResolution *resolution);
-static void check_sequencer_wakeup(BDRRelation *rel);
+static void check_bdr_wakeups(BDRRelation *rel);
#ifdef BUILDING_BDR
static HeapTuple process_queued_drop(HeapTuple cmdtup);
#endif
ExecCloseIndices(estate->es_result_relation_info);
- check_sequencer_wakeup(rel);
+ check_bdr_wakeups(rel);
/* execute DDL if insertion was into the ddl command queue */
if (RelationGetRelid(rel->rel) == QueuedDDLCommandsRelid ||
PopActiveSnapshot();
- check_sequencer_wakeup(rel);
+ check_bdr_wakeups(rel);
/* release locks upon commit */
index_close(idxrel, NoLock);
PopActiveSnapshot();
- check_sequencer_wakeup(rel);
+ check_bdr_wakeups(rel);
index_close(idxrel, NoLock);
bdr_heap_close(rel, NoLock);
}
static void
-check_sequencer_wakeup(BDRRelation *rel)
+check_bdr_wakeups(BDRRelation *rel)
{
-#ifdef BUILDING_BDR
+ Oid schemaoid = RelationGetNamespace(rel->rel);
Oid reloid = RelationGetRelid(rel->rel);
+ if (schemaoid != BdrSchemaOid)
+ return;
+
+ /* has the node/connection state been changed on another system? */
+ if (reloid == BdrNodesRelid)
+ bdr_connections_changed(NULL);
+
+#ifdef BUILDING_BDR
if (reloid == BdrSequenceValuesRelid ||
reloid == BdrSequenceElectionsRelid ||
reloid == BdrVotesRelid)
PG_FUNCTION_INFO_V1(bdr_connections_changed);
-Datum
-bdr_connections_changed(PG_FUNCTION_ARGS);
-
/* In the commit hook, should we attempt to start a per-db worker? */
static bool xacthook_registered = false;
static bool xacthook_connections_changed = false;