Wen Hui 06c087e5ce fix invalid master_link_down_since_seconds in info repication (#8785)
When replica never successfully connect to master, server.repl_down_since
will be initialized to 0, therefore, the info master_link_down_since_seconds
was showing the current unix timestamp, which does not make much sense.

This commit fixes the issue by showing master_link_down_since_seconds to -1.
means the replica never connect to master before.

This commit also resets this variable back to 0 when a replica is turned into
a master, so that it'll behave the same if the master is later turned into a
replica again.

The implication of this change is that if some app is checking if the value is > 60
do something, like conclude the replica is stale, this could case harm (changing
a big positive number with a small one).
2021-04-19 09:34:21 +03:00
..
2020-11-09 21:48:56 -08:00
2021-04-01 12:45:15 +03:00
2020-04-24 17:11:21 -07:00
2019-02-24 21:38:15 +01:00
2021-04-06 12:42:18 +03:00
2020-10-27 15:04:18 +02:00
2021-02-24 10:10:02 +02:00
2020-05-05 23:35:08 -04:00
2020-09-29 15:52:13 +03:00
2019-11-19 17:23:47 +08:00
2019-10-02 11:30:20 +02:00
2021-04-01 12:45:15 +03:00
2021-01-04 17:02:57 +02:00
2021-01-28 16:19:43 +02:00
2020-07-21 08:13:05 +03:00