Commit Graph

441 Commits

Author SHA1 Message Date
Jingyu Zhou 2d2a2144f4
Update copyright years to 2013-2026 (#12653)
No functional changes.
2026-01-22 10:49:41 -08:00
Jingyu Zhou 271851906e
Re-recruit log routers after failures to avoid recoveries (#12558)
* Re-recruit log routers after failures

Log routers are stateless roles that can reconstruct its state after crash.
This is an attemp to avoid triggering recovery if one of log routers crashed.
To simplify the work, only the current generations of log routers are monitored
and re-recruited after crashes. Previous generations of log routers are not
handled in this change, as they are short lived and purged after recovery
reaches the fully_recovered state.

* Monitor log routers after full recovery

I.e., monitorAndRecruitLogRouters() waits for full recovery.

* Some cleanup

* Add WorkerCache for log routers

To avoid duplicated log routers running, though only one will be used (but it's
confusing when debugging).

20251114-230514-jzhou-59d6afe1e475c495

* Fix monitoring to happen after full recovery

20251115-041144-jzhou-4278fe608ed051b7

* Keep monitoring log routers before recovery completion

20251115-050228-jzhou-7c37cfb1d6e36ced

* monitorAndRecruitLogRouters detects recoveries

20251115-205132-jzhou-4d50f7c5914e883a

* Make monitorAndRecruitLogRouters long running

20251115-210426-jzhou-e63a8fcf26a76c81

* Recruit failed log routers in parallel

20251115-222239-jzhou-9eb2287e12c93f7a

* Rix replaced log router's begin version

Use the TLog's reply.popped version as its start version.

20251116-025329-jzhou-51a4def306038241

* clang-format fix

* Address review comments

20251120-221940-jzhou-28d51f8a0400377e             compressed=True data_size=37463028 duration=8246235 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=0:51:39 sanity=False started=100000 stopped=20251120-231119 submitted=20251120-221940 timeout=5400 username=jzhou

* Add exponential backoff for log router re-recruitment

20251121-041700-jzhou-7126a109c1e39c76

* Fix crashes

20251121-043947-jzhou-6f373c1c64faa1b2

* Disable a verbose event

* Add CC_RERECRUIT_LOG_ROUTER_ENABLED to control this feature

20251215-220843-jzhou-70dad477b39640e9
2025-12-17 15:42:49 -08:00
Sreenath Bodagala f941541519
- Ensure that the logSets (in TagPartitionedLogSystem) receive identifiers in (#12529)
a consistent way
- Resolve an issue that was causing a unicast recovery related unit test
  to fail
2025-11-03 11:54:40 -05:00
Syed Paymaan Raza b23faeac5b
Recovery trigger observability (#12490) 2025-10-30 16:16:56 -07:00
Syed Paymaan Raza 841e1e1b47
Fix LowLatency* tests (#12483)
* Test observability

* Tune recovery init timeouts in LowLatency test

* further tuning

* self review

* more tuning

* have an explicit disable knob for simulation

* minor formatting/spacing fix

* add clarifying comment
2025-10-22 14:58:54 -07:00
gxglass 16a9edab44
delete cacheTag (#12492)
* delete cacheTag per code review request. Follow-up on PR#12486, deletion of storage cache feature.

* clean up comment about tagLocalitySpecial
2025-10-21 22:42:18 -07:00
Syed Paymaan Raza 99012d2e05
Clean up some headers and dead code (#12488)
* Clean up some headers and dead code

* self review
2025-10-21 10:30:50 -07:00
Dan Lambright 9954593cb9
add unit tests for getRecoverVersionUnicast() (#12429)
* add unit tests for getRecoverVersionUnicast()

* add version vector runtime check

* Add PartialAvailabilityPolicyFail, refactor tests to TagPartitionedLogSystemRecoveryTests.actor.cpp

---------

Co-authored-by: Dan Lambright <hlambright@apple.com>
2025-10-15 12:05:47 -04:00
Syed Paymaan Raza 185cc52541
Timeout monitor for recovery phase initializing_transaction_servers (#12396)
* Recovery init timeouts

* knob for dropping

* fixes based on 100K

* bug fix: void -> never

* bug fix: tooManyUnfinishedRecoveries

* remove buggify server knob, fix gcgen in another way by reducing exp factor multiplier

* self review

* more self review

* fmt fix

* self review

* address feedback
2025-10-09 15:53:37 -07:00
Sreenath Bodagala 9c48e3c19b
- The unicast recovery algorithm should account for all versions (#12417)
starting from "max(KCV)" onwards. The current implementation allows
the version whose prevVersion is equal to "max(KCV)" to be skipped
and could cause the algorithm to pick an incorrect recovery version.
2025-10-08 21:31:32 -07:00
Dan Lambright be8f3a819b
TeamScale cleanup for TagPartitionedLogSystem.actor.cpp (#12408) 2025-10-02 19:42:03 -07:00
Syed Paymaan Raza 269013d07d
Long recovery observability (phase: initializing_transaction_servers) (#12384)
* More recovery observability for initializing_transaction_servers

* observability using new lib

* consistent naming

* address comments

* remove standalone, rely on upfront std::string copying
2025-09-23 22:29:53 -07:00
Sreenath Bodagala d7e1e6e4aa
Extensions to the peek logic to get it to work correctly with version vector/unicast (#12281)
* More version vector/unicast related changes in order to get the
peek logic to work correctly during recovery:
- Ensure that non-buddy servers can return an empty version range
only if they are known to have been locked
- Make the MergePeekCursor follow the same logic that the
SetPeekCursor does when unicast is enabled

* - Do not try to reference known-locked-tLog-list (a version vector
specific data structure) when version vector is disabled.

* - Resolve a bug in the context of deciding when an empty version range
can be returned by a tLog

* - Code review related changes

* - More review related changes

* - Another review related change

* - More review related changes

* - More review related changes
2025-09-16 15:34:13 -04:00
Sreenath Bodagala 2734dd09ca
Version vector related extensions to the recovery restart logic (#12284)
* - Version vector/Unicast specific: Restart recovery if the list of
available tLogs change in such a way that the current in-progress
recovery could stall.

* - Code review related changes
2025-09-16 08:56:56 -07:00
Sreenath Bodagala 2d5d695617
Make log servers return an empty version range only when it is correct to do so (#12188)
* In the context of version vector/unicast, make log servers return
an empty version range (on peeks) only when it is correct to do so.
This is so the receiver will receive all versions (even though the
sender is sending an empty version range) that it is supposed to
receive.

Changes:
- Make the cluster controller collect the set of log servers participated
in recovery and propagate that information to the other processes.
- Extend the ServerPeekCursor to take a flag that tells the source log
server whether it can return an empty version range or not (in the context
of version vector/unicast), and make the source log server return an empty
version range only when this flag is set.
- Make the peek APIs set the flag appropriately when initializing
ServerPeekCursors.
- Also, take the internal logic used by SetPeekCursor and MergedPeekCursor
into account while initializing the above mentioned flag.

* - Update the member variable ("bestServer") after updating the argument

* - Review comments related changes

* - Review comments related changes
2025-07-16 14:39:54 -07:00
Jingyu Zhou 774c792e14
Fix a race that can cause recovery to be stuck (#12212)
* Fix a race that can causes recovery to be stuck

When purging old generations, these no longer needed generations are removed in
the in-memory LogSystem data structure. Then the change is made durable on
coordinators.

If there is a recovery happened before the change is durable, and ServerDBInfo
broadcast is sent to the old tlogs and they can be displaced/removed. As a
result, the recovery will become stuck waiting for locking these old tlogs.

This PR updates the purging so that it never directly changes the in-memory data
structure and only modifies states on coordinators. So next recovery will pick
up the change.

* Add in-memory purging of old generation after writing coordinators

This allows old tlogs to be removed after CC purges them.

20250628-180019-jzhou-69511e1cbc01ab08
2025-06-30 16:21:45 -07:00
Dan Lambright b52d870f52
Fix how non local restricted log sets are built (#12086)
Co-authored-by: Dan Lambright <hlambright@apple.com>
2025-04-17 21:01:56 -04:00
Jingyu Zhou f1ecdb3a99
Fix backup worker assertion failure on memory usage (#12046)
* Fix backup worker assertion failure on memory usage

pullAsyncData() can be cancelled thus not take() some of the memory used by
the in memory queue.

20250320-171737-jzhou-752fd8c45fdadd4a

100k tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250320-172251-jzhou-3bc7db8e7ce5e1de

* Refactor such that messages in the queue have to reserve memory first

Thus, when we release the memory, it must have already been reserved.

100k ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250320-234748-jzhou-a159972dd0a72e03

20250320-235252-jzhou-54a6ae8c67873b59

* Fix a backup worker assertion failure

The pop version obtained from GRV proxy replies may go backwards, which can
cause assertion failure when pulling mutations, i.e., missing mutations. Fix
this bug and add an assertion that popVersion can go lower.

100k 20250321-012019-jzhou-01eb56938cf0a3fc

100k tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250321-012144-jzhou-68181bb51aedbb5d

* Fix assertion failure of triggered version

The triggered version could be the same as popVersion.

20250321-025429-jzhou-a088c3f119331b93

100k tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250321-025532-jzhou-77e2dbd5fd035157

* Update fdbserver/BackupWorker.actor.cpp

Co-authored-by: Syed Paymaan Raza <1238752+spraza@users.noreply.github.com>

---------

Co-authored-by: Syed Paymaan Raza <1238752+spraza@users.noreply.github.com>
2025-03-21 13:55:27 -07:00
Sreenath Bodagala 56402dbbf1
Extend the unicast based recovery algorithm to do the replication policy check (#11996)
* - Extend the unicast based recovery algorithm to do the replication policy check

* - Review comments related changes

* - Review and compilation related changes
2025-03-12 18:01:38 -04:00
Dan Lambright 8bba38b180
Version vector: compute locations only once during commits. (#11924)
* During commits with version vector enabled, compute location list only once, as recalcuating could
generate a different random number, hence a different set of locations.

* Respond to review comments.

* Select replicas from locations returned from resolver.

* Respond to review comments

---------

Co-authored-by: Dan Lambright <hlambright@apple.com>
2025-03-04 17:09:06 -05:00
Sreenath Bodagala af7b34e431 - Correct an issue to do with populating the list of reporting log servers
during recovery with version vector - the list of reporting log servers
should include even those that have an empty unknown committed version list.
2025-02-25 20:32:22 +00:00
Sreenath Bodagala 9adaa6eef2
Do not use "safe range" logic in recovery code when version vector is enabled #11887
* - When version vector is enabled use "min(DV)" as the recovery
version when trying to decide whether to restart recovery or not.

* - Address a review comment

* - Address a review comment
2025-02-10 14:38:19 -08:00
Sreenath Bodagala 97847f3fbf - Do not do the replication policy validation check when trying to
find the recovery version in the context of version vector. We will
need to extend the version vector recovery algorithm to do this
check in an efficient manner later.
2025-01-17 11:11:15 +00:00
Sreenath Bodagala 5a88f43ca0
- Use "count()", instead of "size()", to find the number of bits set (#11857)
in a dynamic_bitset structure.
2025-01-03 13:38:27 +05:30
Sreenath Bodagala 36829092b3
- Modify the unicast-based recovery version computation algorithm (#11770)
the following ways:

- Make it use "max(KCV)", instead of "min(KCV)", as the default
recovery version
- Make it return the <max(KCV), recovery version> pair as output
- Make the invoker use the "max(KCV)" version returned by the
algorithm
- Address a bug related to the computation of recovery version (in
the case where a subset of log servers have empty
"unknownCommittedVersions" list)

And, make the invoker compute the max() and min() of recovery versions
of primary and satellite DCs based on the recovery versions computed
by the appropriate (with/without unicast) recovery version computation
algorithms.
2024-12-03 11:41:32 -05:00
Johannes M. Scheuermann 786a220e35 Add log system debug ID to trace event 2024-11-12 14:32:24 +01:00
Dan Lambright a63631f68c
fix vv unicast recovery for streaming peek. (#11745)
Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-11-03 12:43:44 -05:00
Dan Lambright 9790a53f7c
Propagate rv to tLogs on version vector recovery (#11677)
* refactor management of cluster recovery version (crv)

- send the crv to tlogs as they rejoin cluster during recovery, not
just when an rv is computed.
- if a tlog has not yet received the crv, wait for it

* Propagate cluster recovery version to tlog for version vector recovery
Enable RECORD_RECOVER_AT_IN_CSTATE to store recovery version in cstate

* respond to review comments

* - dont sent rv to old tlog generations
- send crv after locking, if rv computed

* Remove CRV RPCs, have cursor pad beyond end tlog to RV

* Send end version in peek request to facility vv recovery

* Fix serialization in peek request interface.

---------

Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-10-22 17:54:26 -04:00
Syed Paymaan Raza c146ee0869
[fdbserver] Use STL contains method and std::find for containment checks (#11702) 2024-10-15 11:40:02 -07:00
Jingyu Zhou f86058fba6
Remove the usage of txsTag (#11688)
* Add assertions to code paths with txsTag

txsTag should be obsolete by now, since it's used in 6.1, which is no longer
supported for upgrade.

* Actually remove txsTag usage

20240926-225930-jzhou-7ed3304c415ae65e

* Remove more code

20240926-235242-jzhou-7ed3304c415ae65e

* Disable two verbose trace events

They can cause TraceTooManyLines errors.
2024-09-30 07:53:37 -04:00
Jingyu Zhou 70f9440e7d
Merge pull request #11648 from sbodagala/main
Refactor version vector related recovery version computation logic
2024-09-23 14:06:21 -07:00
Sreenath Bodagala 3cd26fb9da - Another const related change 2024-09-20 17:11:54 +00:00
Sreenath Bodagala 2cf2e3ea43 - Address PR review comments 2024-09-20 16:53:18 +00:00
Jingyu Zhou 35c0580f9f Remove collectTags from BufferedCursor
No need to support upgrades from 5.x to 6.0 now.

20240918-174602-jzhou-75febe944d1d84b3
2024-09-18 11:23:09 -07:00
Jingyu Zhou fc30fc269e Remove dead code after removing tagLocalityUpgraded usage
20240918-170752-jzhou-33111b2c3e6776aa
2024-09-18 11:23:09 -07:00
Jingyu Zhou 7b76561bb9 Remove tagLocalityUpgraded usage at various places
Since we have removed old tlog implementation, so the code path using this tag
can be deleted to simplify the code.
2024-09-18 11:23:09 -07:00
Sreenath Bodagala 9ebb1b7391 - Disable logWriteAntiQuorum when version vector is enabled
- Refactor the version vector related recovery version computation
logic in order to make it work better with the recovery restart logic
2024-09-11 19:51:41 +00:00
Sreenath Bodagala daca092939
- Address a bug related to computing the ids of log servers (#11623) 2024-09-03 21:15:08 -07:00
Dan Lambright 4e96c3cab2
refactor to use struct rather than tuple for "uncommitedVersions" (#11619)
* refactor to use struct rather than tuple for uncommitedVersions

* Document UnknownCommittedVersions struct

---------

Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-08-30 14:28:14 -07:00
Sreenath Bodagala e490ba8c21
Address an assertion failure (#11617) 2024-08-29 11:22:30 -07:00
Dan Lambright bf292a6c95
Stash correct id for tlog idenfication in recovery (#11604)
Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-08-26 15:39:40 -04:00
Dan Lambright d040b9a24c
check existence of optional interface (#11593)
Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-08-22 23:28:30 -04:00
Dan Lambright 94fba2cce0
cluster level RV when tLogs advance at different rates (#11557)
* simulate more than one tlog

* Draft use cluster RV for tlogs in version vector

* add TestTLogRecovery2

* Respond to review comments

* Add assert

* Send clusterRV to all locked tlogs

* Fix typo on rebase

* add memory managed IdToInterf structure

---------

Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-08-22 16:17:02 -04:00
Sreenath Bodagala 7efbf9f041
Recovery version computation when version vector unicast is enabled (#11565)
* - Recovery version computation when version vector unicast is enabled

* - Address a review comment

* - Modify code to not use "max(DV)" as the starting recovery version

* - Remove references to "max(DV)"

* - Address a review comment

* - Address PR review comments

* - Address a review comment
2024-08-20 13:58:18 -04:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Xiaoge Su b324bfb9b9
When a commit is cancelled, record all unresponsive/failed TLogs (#11459)
* When a commit is cancelled, record all unresponsive/failed TLogs

* fixup!

* fixup!

* fixup!
2024-07-23 17:26:11 -07:00
Dan Lambright bd3769cc49
Fix calculation of empty messages for vv case (#11224)
Co-authored-by: Dan Lambright <hlambright@apple.com>
2024-02-27 17:20:36 -05:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Zhe Wu b2197e0062 Do not track TLog recovery if old generations have invalid recover at version. This can happen when we just turn on tracking TLog recovery. 2023-05-16 13:20:00 -07:00
Zhe Wu a956979c32 Replace oldestGenerationStartVersion with oldestGenerationRecoverAtVersion 2023-05-16 13:09:34 -07:00