but why? If I reboot the other node, the system become MASTER.
That is because the other system stops sending carp announcements
when you reboot it. This is unrelated to the demote counter. The demote
counter only matters as long as another carp MASTER remains visible.
A forced failover like this could break active connections.
The pfsync interfaces adds 32 to the carp demote counter when it comes
up,
and it removes 32 from the demote counter once it has obtained an
up-to-date
copy of the state table, which can take some time.
This prevents the box from becoming MASTER while it may not yet know
about all the currently active connections.
But why the 1st system is switchback to BACKUP if the 2nd system is Up
again? Normaly 1st should stay MASTER, because at this time, the 1st one
have the most recent state table which should be now send to the 2nd
one. Yes, it's because of the higher demotioncount then the 2nd system,
but if the 1st one standalone, it should self demoted to 0/1 bei pfsync
because there is no other system?
I wait more then an hour, but the system is still on 33. So it seems the
state table is never synced completly, but if I compare both with "pfctl
-s state" they look are in sync - strange.
I never had this issue and we use a lot of cluster setups like these in
the past.