Jingyu Zhou 05e63bc703
Fix orphaned storage server due to force recovery (#6914)
* Fix orphaned storage server due to force recovery

The force recovery can roll back the transaction that adds a storage server.
However, the storage server may now at version B > A, the recovery version.
As a result, its peek to buddy TLog won't return TLogPeekReply::popped to
trigger its exit, and instead getting a higher version C > B back. To the
storage server, this means the message is empty, thus not removing itself and
keeps peeking.

The fix is to instead of using recovery version as the popped version for the
SS, we use the recovery transaction version, which is the first transaction
after the recovery. Force recovery bumps this version to a much higher version
than the SS's version. So the TLog would set TLogPeekReply::popped to trigger
the storage server exit.

* Fix tlog peek to disallow return empty message between recoveredAt and recovery txn version

This contract today is not explicitly set and can cause storage server to fail
with assertion "rollbackVersion >= data->storageVersion()". This is because if
such an empty version is returned, SS may advance its storage version to a
value larger than the rollback version set in the recovery transaction.

The fix is to block peek reply until recovery transaction has been received.

* Move recoveryTxnReceived to be per LogData

This is because a shared TLog can have a first generation TLog which is already
setting the promise, thus later generations won't wait for the recovery version.
For the current generation, all peeks need to wait, while for older generations,
there is no need to wait (by checking if they are stopped).

* For initial commit, poppedVersion needs to be at least 2

To get rid of the previous unsuccessful recovery's recruited seed
storage servers.
2022-05-02 17:17:37 -07:00
..
2021-06-28 11:14:55 +08:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-04-08 14:15:25 -07:00
2022-04-08 14:15:25 -07:00
2022-04-07 17:34:13 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-04-21 21:40:49 -07:00
2022-03-21 13:36:23 -07:00
2022-03-17 16:53:10 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-28 22:49:03 -07:00
2022-03-28 22:54:00 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-11 12:23:01 -04:00
2022-03-21 13:36:23 -07:00
2022-04-14 12:03:39 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-03-21 13:36:23 -07:00
2022-04-08 17:28:16 -04:00