• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

patroni / patroni / 14597528825
100%
master: 100%

Build:
Build:
LAST BUILD BRANCH: REL_4_0
DEFAULT BRANCH: master
Ran 22 Apr 2025 02:40PM UTC
Jobs 3
Files 57
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Apr 2025 02:36PM UTC coverage: 99.855% (-0.006%) from 99.861%
14597528825

push

github

CyberDem0n
Ignore stale Etcd nodes by comparing cluster term (#3318)

During the network split some Etcd nodes could become stale, however they are still available for read requests. It is not a problem for the old primary, because such etcd nodes are not writable and primary demotes when fails to update the leader lock.

When the network split resolves and Etcd node connects back to the cluster, it may trigger the leader election (in Etcd), what typically results in some failures of client requests. Such state quickly resolves, and client requests could be retried. but it takes some time for the disconnected node to catch up. During this time it shows stale data for read requests without quorum requirement.

It could happen that the current Patroni primary is impacted by failed client requests while Etcd cluster is doing leader elections and there is a chance that it may switch to the stale Etcd node, discover that someone else is a leader, and demote.

To protect from this situation we will memorize the last known "term" of the Etcd cluster and when executing client requests we will compare the "term" reported by Etcd node with the term we memorized. It allows to detect stale Etcd nodes and temporary ignore them by switching to some other available Etcd nodes.

An alternative approach to solve this problem would be using quorum/serializable reads for read requests, but it will increase resource usage on Etcd nodes.

Close #3314

27 of 27 new or added lines in 2 files covered. (100.0%)

4 existing lines in 3 files now uncovered.

14436 of 14457 relevant lines covered (99.85%)

2.98 hits per line

Coverage Regressions

Lines Coverage ∆ File
2
99.85
0.0% patroni/ha.py
1
99.5
0.0% patroni/__main__.py
1
99.88
-0.12% patroni/postgresql/config.py
Jobs
ID Job ID Ran Files Coverage
1 unit-macos - 14597528825.1 22 Apr 2025 02:49PM UTC 57
99.78
GitHub Action Run
2 unit-windows - 14597528825.2 22 Apr 2025 02:49PM UTC 57
98.82
3 unit-ubuntu - 14597528825.3 22 Apr 2025 02:49PM UTC 57
99.85
Source Files on build 14597528825
  • Tree
  • List 57
  • Changed 6
  • Source Changed 0
  • Coverage Changed 6
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • 5016ce94 on github
  • Prev Build on REL_4_0 (#13439048762)
  • Next Build on REL_4_0 (#14597957612)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc