Skip to content

Commit

Permalink
Merge pull request #116 from Aiven-Open/turn_synchronous_commit_off
Browse files Browse the repository at this point in the history
Use synchronous_commit to off
  • Loading branch information
alexole committed Feb 5, 2024
2 parents 028ba9e + c45a0fc commit 5c6f31f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pglookout/cluster_monitor.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,10 @@ def _connect_to_db(self, instance, dsn):
conn = psycopg2.connect(dsn=dsn, async_=True)
wait_select(conn)
self.log.debug("Connected to %s", inst_info_str)
cursor = conn.cursor()
cursor.execute("SET synchronous_commit = off")
wait_select(conn)
self.log.debug("synchronous_commit set to off in the session")
except (PglookoutTimeout, psycopg2.OperationalError) as ex:
self.log.warning(
"%s (%s) connecting to %s (%s)",
Expand Down

0 comments on commit 5c6f31f

Please sign in to comment.