Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions include/spock_sync.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,4 @@ extern bool wait_for_sync_status_change(Oid subid, const char *nspname,
extern void truncate_table(char *nspname, char *relname);
extern List *get_subscription_tables(Oid subid);

#ifdef WIN32
extern void QuoteWindowsArgv(StringInfo cmdline, const char *argv[]);
#endif

#endif /* SPOCK_SYNC_H */
16 changes: 0 additions & 16 deletions src/spock.c
Original file line number Diff line number Diff line change
Expand Up @@ -820,28 +820,12 @@ spock_temp_directory_assing_hook(const char *newval, void *extra)
}
else
{
#ifndef WIN32
const char *tmpdir = getenv("TMPDIR");

if (!tmpdir)
tmpdir = "/tmp";
#else
char tmpdir[MAXPGPATH];
int ret;

ret = GetTempPath(MAXPGPATH, tmpdir);
if (ret == 0 || ret > MAXPGPATH)
{
ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
errmsg("could not locate temporary directory: %s\n",
!ret ? strerror(errno) : "")));
return false;
}
#endif

spock_temp_directory = strdup(tmpdir);

}

if (spock_temp_directory == NULL)
Expand Down
6 changes: 6 additions & 0 deletions src/spock_exception_handler.c
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,12 @@ add_entry_to_exception_log(Oid remote_origin, TimestampTz remote_commit_ts,
* This function is invoked when the configured exception handling behavior is
* SUB_DISABLE, meaning the subscription must be suspended instead of skipping
* or retrying the failing transaction.
*
* May be called with or without an active transaction. If no transaction is
* in progress, one is started and committed internally. If the caller already
* holds an open transaction, it is the caller's responsibility to ensure that
* transaction is either committed or terminates with a FATAL error; otherwise
* the subscription state change and exception_log entry will be rolled back.
*/
void
spock_disable_subscription(SpockSubscription *sub,
Expand Down
5 changes: 3 additions & 2 deletions src/spock_failover_slots.c
Original file line number Diff line number Diff line change
Expand Up @@ -1584,6 +1584,9 @@ attach_to_walsender(Port *port, int status)
void
spock_init_failover_slot(void)
{
#if PG_VERSION_NUM < 180000
BackgroundWorker bgw;
#endif
DefineCustomStringVariable(
"spock.pg_standby_slot_names",
"list of names of slot that must confirm changes before they're sent by the decoding plugin",
Expand Down Expand Up @@ -1648,8 +1651,6 @@ spock_init_failover_slot(void)
elog(LOG, "spock: skipping failover slot worker on PostgreSQL 18+ "
"(use sync_replication_slots = on instead)");
#else
/* Run the worker. */
BackgroundWorker bgw;

memset(&bgw, 0, sizeof(bgw));
bgw.bgw_flags =
Expand Down
Loading
Loading