Skip to content

Commit

Permalink
reinitialize pwenc in vrrp_backup
Browse files Browse the repository at this point in the history
  • Loading branch information
yocalebo committed Dec 13, 2024
1 parent 91b7c69 commit dff2676
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/middlewared/middlewared/plugins/failover_/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# from middlewared.plugins.failover_.zpool_cachefile import ZPOOL_CACHE_FILE
from middlewared.plugins.failover_.event_exceptions import AllZpoolsFailedToImport, IgnoreFailoverEvent, FencedError
from middlewared.plugins.failover_.scheduled_reboot_alert import WATCHDOG_ALERT_FILE
from middlewared.plugins.pwenc import PWENC_FILE_SECRET

logger = logging.getLogger('failover')
FAILOVER_LOCK_NAME = 'vrrp_event'
Expand Down Expand Up @@ -901,6 +902,18 @@ def vrrp_backup(self, job, fobj, ifname, event):
logger.warning('Stopping fenced')
self.run_call('failover.fenced.stop')

# In the rare case where the pwenc_secret file doesn't match, we'll
# copy over the secret seed file from the active and reinitialize
try:
self.run_call(
'failover.call_remote',
'failover.send_small_file',
[PWENC_FILE_SECRET],
{'raise_connect_error': False}
)
except Exception:
self.logger.error('Failed to reinitialize pwenc', exc_info=True)

# Now that fenced is stopped, attach NVMe/RoCE.
logger.info('Start bring up of NVMe/RoCE')
try:
Expand Down

0 comments on commit dff2676

Please sign in to comment.