Here is documentation of Patroni https://patroni.readthedocs.io/en/latest/replication_modes.html.
There are two options: maximum_lag_on_failover and synchronous_mode.
In the project, I see these two options are set (synchronous_mode: true, maximum_lag_on_failover: 1048576 ). Does it make sense?
One says you can promote secondary to primary with a lag of 1048576 bytes, and second, says you can't promote secondary to primary if you have any lag. And the second question does maximum_lag_on_failover works only on async replication, and synchronous_mode only on sync replication?
I do not have enough reputation to post it as a comment, but, I suppose that maximum_lag_on_failover still could be used with synchronous_mode: true, because as it is said in docs:
Turning on synchronous_mode does not guarantee multi node durability of commits under all circumstances. When no suitable standby is available, primary server will still accept writes, but does not guarantee their replication.. So, in order to provide availability patroni in synchronous_mode stil allowed to lose some transactions. Also If I recall correctly, in our project we had both options set and everything worked normally. The other question is: Is it possible to use maximum_lag_on_failover together with synchronous_mode_strict: true