&monitor_threads,
true
},
+ {
+ {
+ (const char *) "enable_version_check",
+ gettext_noop("Should services check release versions "
+ "and fail on differences?"),
+ NULL,
+ SLON_C_BOOL,
+ },
+ &enable_version_check,
+ true
+ },
+ {
+ {
+ (const char *) "remote_listen_serializable_transactions",
+ gettext_noop("Determines if the remote listener should use serializable transactions. "
+ "This setting trades between strict isolation and avoiding blocking "
+ "for lock management."),
+ NULL,
+ SLON_C_BOOL,
+ },
+ &remote_listen_serializable_transactions,
+ true
+ },
{{0}}
};
extern int quit_sync_provider;
extern int quit_sync_finalsync;
extern bool keep_alive;
+extern bool enable_version_check;
+extern bool remote_listen_serializable_transactions;
extern int keep_alive_idle;
extern int keep_alive_interval;
extern int keep_alive_count;
#include "slon.h"
bool keep_alive;
+bool enable_version_check;
int keep_alive_idle;
int keep_alive_count;
int keep_alive_interval;
PGresult *res;
int retval = 0;
+ if (! enable_version_check)
+ {
+ return 0;
+ }
+
/*
* Select the version number from the schema
*/
extern char *lag_interval;
int remote_listen_timeout;
+bool remote_listen_serializable_transactions;
static int sel_max_events = 0;
}
if (PQserverVersion(dbconn) >= 90100)
{
- slon_mkquery(&query1, "SET SESSION CHARACTERISTICS AS TRANSACTION read only deferrable");
- res = PQexec(dbconn, dstring_data(&query1));
- if (PQresultStatus(res) != PGRES_COMMAND_OK)
- {
- slon_log(SLON_ERROR,
- "remoteListenThread_%d: \"%s\" - %s",
- node->no_id,
- dstring_data(&query1), PQresultErrorMessage(res));
- PQclear(res);
- slon_disconnectdb(conn);
- free(conn_conninfo);
- conn = NULL;
- conn_conninfo = NULL;
- rc = sched_msleep(node, pa_connretry * 1000);
- if (rc != SCHED_STATUS_OK && rc != SCHED_STATUS_CANCEL)
- break;
-
- continue;
- }
-
- }
- if (PQserverVersion(dbconn) >= 90100)
- {
- slon_mkquery(&query1, "SET SESSION CHARACTERISTICS AS TRANSACTION read only isolation level serializable deferrable");
+ char buf[200];
+ sprintf(buf, "SET SESSION CHARACTERISTICS AS TRANSACTION read only isolation level %s",
+ remote_listen_serializable_transactions ? "serializable deferrable" : "repeatable read");
+ slon_mkquery(&query1, buf);
res = PQexec(dbconn, dstring_data(&query1));
if (PQresultStatus(res) != PGRES_COMMAND_OK)
{
get_share_path(myfull_path, share_path);
}
#else
- strcpy(share_path, PGSHARE);
+ char *pgHome = getenv("PG_HOME");
+ if (pgHome)
+ {
+ snprintf(share_path, MAXPGPATH-1, "%s/share", pgHome);
+ share_path[MAXPGPATH-1] = '\0';
+ }
+ else
+ {
+ strcpy(share_path, PGSHARE);
+ }
#endif
+printf("Share path is %s\n",share_path);
if (optind < argc)
{