Skip to content

Conversation

taurus-forever
Copy link
Contributor

Port from PG14 #1173

Issue

In case of the split brain OR old primary cluster re-joining,
the special Patroni config options did re-silver the data,
potentially loosing the data on old-Primary unit (
as it cannot re-join current Primary due to timelines divergence).

The follow-up charm improvements are necessary to simplify re-init for user,
but for now let's disable dangerous Patroni options added in 29b8098.

Solution

Disable Patroni config options explicitly:
remove_data_directory_on_rewind_failure and
remove_data_directory_on_diverged_timelines.
They are disabled by default in Patroni.

Fixes 1153

Checklist

  • I have added or updated any relevant documentation.
  • I have cleaned any remaining cloud resources from my accounts.

Disable Patroni config options explecitely:
remove_data_directory_on_rewind_failure and
remove_data_directory_on_diverged_timelines.

P.S. they are disabled by default in Patroni.

(cherry picked from commit 10ace6a)
Copy link

codecov bot commented Sep 22, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.51%. Comparing base (d1b3c8c) to head (cff82b3).
⚠️ Report is 1 commits behind head on 16/edge.

❌ Your project status has failed because the head coverage (64.51%) is below the target coverage (70.00%). You can increase the head coverage or adjust the target coverage.

Additional details and impacted files
@@           Coverage Diff            @@
##           16/edge    #1174   +/-   ##
========================================
  Coverage    64.51%   64.51%           
========================================
  Files           17       17           
  Lines         4337     4337           
  Branches       671      671           
========================================
  Hits          2798     2798           
  Misses        1357     1357           
  Partials       182      182           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link

@7annaba3l 7annaba3l left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me

@dragomirp dragomirp changed the title DPE-8337 Disable Patroni config to prevent possible dataloose [DPE-8337] Disable Patroni config to prevent possible data loss Sep 23, 2025
@taurus-forever taurus-forever merged commit 6652b65 into 16/edge Sep 24, 2025
460 of 470 checks passed
@taurus-forever taurus-forever deleted the alutay/disable_pg_rewind_pg16 branch September 24, 2025 12:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected Libraries: Out of sync

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants