7979 PostgreSQLGetCurrentTimelineError ,
8080 PostgreSQLGrantDatabasePrivilegesToUserError ,
8181 PostgreSQLListUsersError ,
82+ PostgreSQLUndefinedHostError ,
8283 PostgreSQLUpdateUserPasswordError ,
8384)
8485from tenacity import RetryError , Retrying , retry , stop_after_attempt , stop_after_delay , wait_fixed
130131)
131132from ldap import PostgreSQLLDAP
132133from relations .async_replication import PostgreSQLAsyncReplication
133- from relations .logical_replication import (
134- LOGICAL_REPLICATION_VALIDATION_ERROR_STATUS ,
135- PostgreSQLLogicalReplication ,
136- )
137134from relations .postgresql_provider import PostgreSQLProvider
138135from relations .tls import TLS
139136from relations .tls_transfer import TLSTransfer
@@ -339,7 +336,7 @@ def __init__(self, *args):
339336 self .tls = TLS (self , PEER )
340337 self .tls_transfer = TLSTransfer (self , PEER )
341338 self .async_replication = PostgreSQLAsyncReplication (self )
342- self .logical_replication = PostgreSQLLogicalReplication (self )
339+ # self.logical_replication = PostgreSQLLogicalReplication(self)
343340 self .restart_manager = RollingOpsManager (
344341 charm = self , relation = "restart" , callback = self ._restart
345342 )
@@ -1516,8 +1513,8 @@ def _on_config_changed(self, event) -> None: # noqa: C901
15161513 # Update the sync-standby endpoint in the async replication data.
15171514 self .async_replication .update_async_replication_data ()
15181515
1519- if not self .logical_replication .apply_changed_config (event ):
1520- return
1516+ # if not self.logical_replication.apply_changed_config(event):
1517+ # return
15211518
15221519 if not self .unit .is_leader ():
15231520 return
@@ -1570,7 +1567,7 @@ def enable_disable_extensions(self, database: str | None = None) -> None:
15701567 )
15711568 self .set_unit_status (BlockedStatus (EXTENSION_OBJECT_MESSAGE ))
15721569 return
1573- except PostgreSQLEnableDisableExtensionError as e :
1570+ except ( PostgreSQLEnableDisableExtensionError , PostgreSQLUndefinedHostError ) as e :
15741571 logger .exception ("failed to change plugins: %s" , str (e ))
15751572 if original_status .message == EXTENSION_OBJECT_MESSAGE :
15761573 self .set_unit_status (ActiveStatus ())
@@ -2001,7 +1998,7 @@ def _on_update_status(self, _) -> None:
20011998
20021999 self .backup .coordinate_stanza_fields ()
20032000
2004- self .logical_replication .retry_validations ()
2001+ # self.logical_replication.retry_validations()
20052002
20062003 self ._set_primary_status_message ()
20072004
@@ -2093,9 +2090,8 @@ def _can_run_on_update_status(self) -> bool:
20932090 return False
20942091
20952092 if (
2096- self .is_blocked
2097- and self .unit .status not in S3_BLOCK_MESSAGES
2098- and self .unit .status .message != LOGICAL_REPLICATION_VALIDATION_ERROR_STATUS
2093+ self .is_blocked and self .unit .status not in S3_BLOCK_MESSAGES
2094+ # and self.unit.status.message != LOGICAL_REPLICATION_VALIDATION_ERROR_STATUS
20992095 ):
21002096 # If charm was failing to disable plugin, try again (user may have removed the objects)
21012097 if self .unit .status .message == EXTENSION_OBJECT_MESSAGE :
@@ -2141,12 +2137,12 @@ def _set_primary_status_message(self) -> None:
21412137 BlockedStatus (self .app_peer_data ["s3-initialization-block-message" ])
21422138 )
21432139 return
2144- if self .unit .is_leader () and (
2145- self .app_peer_data .get ("logical-replication-validation" ) == "error"
2146- or self .logical_replication .has_remote_publisher_errors ()
2147- ):
2148- self .unit .status = BlockedStatus (LOGICAL_REPLICATION_VALIDATION_ERROR_STATUS )
2149- return
2140+ # if self.unit.is_leader() and (
2141+ # self.app_peer_data.get("logical-replication-validation") == "error"
2142+ # or self.logical_replication.has_remote_publisher_errors()
2143+ # ):
2144+ # self.unit.status = BlockedStatus(LOGICAL_REPLICATION_VALIDATION_ERROR_STATUS)
2145+ # return
21502146 if (
21512147 self ._patroni .get_primary (unit_name_pattern = True ) == self .unit .name
21522148 or self .is_standby_leader
@@ -2413,7 +2409,7 @@ def update_config(
24132409 self .model .config , self .get_available_memory (), limit_memory
24142410 )
24152411
2416- replication_slots = self .logical_replication .replication_slots ()
2412+ # replication_slots = self.logical_replication.replication_slots()
24172413
24182414 # Update and reload configuration based on TLS files availability.
24192415 self ._patroni .render_patroni_yml_file (
@@ -2430,7 +2426,7 @@ def update_config(
24302426 parameters = pg_parameters ,
24312427 no_peers = no_peers ,
24322428 user_databases_map = self .relations_user_databases_map ,
2433- slots = replication_slots ,
2429+ # slots=replication_slots,
24342430 )
24352431 if no_peers :
24362432 return True
@@ -2464,7 +2460,7 @@ def update_config(
24642460
24652461 self ._api_update_config ()
24662462
2467- self ._patroni .ensure_slots_controller_by_patroni (replication_slots )
2463+ # self._patroni.ensure_slots_controller_by_patroni(replication_slots)
24682464
24692465 self ._handle_postgresql_restart_need ()
24702466
0 commit comments