Commit Graph

790 Commits

Author SHA1 Message Date
Michael Stack 9d0e169496
Add error_code_audit_storage_task_outdated to bypass list rather than do special-case handling (#12652) 2026-01-22 13:49:11 -08:00
Jingyu Zhou 2d2a2144f4
Update copyright years to 2013-2026 (#12653)
No functional changes.
2026-01-22 10:49:41 -08:00
Jingyu Zhou 7f06b8e334 Fix IDE build compiling errors 2026-01-19 14:29:12 -08:00
Vishesh Yadav af732673f1
Implement Exclude commands in gRPC (#12603) 2026-01-12 11:38:36 -08:00
Michael Stack aa35d6cc29
Add restore validation feature: restores to special keyspace allowing validating backup/restore in single cluster (space willing) (#12573)
* Add restore validation feature with simplified backup gap fix

Implements restore validation using audit_storage to verify backup/restore
correctness. Includes a minimal fix for the backup gap bug.

Key components:
- ValidateRestore audit type: compares source keys against restored keys
  at \xff\x02/rlog/ prefix in storage server
- DD audit fixes: propagate validation errors, handle DD failover correctly
- RestoreValidation and BackupAndRestoreValidation workloads for testing
- Simplified backup gap fix: prevent snapshot from finishing in the same
  iteration it dispatches the last tasks (single flag + one check)
2026-01-07 15:23:02 -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
gxglass bab7637d87
Delete multitenant and metacluster features (#12583)
These features have been previously marked for deletion per PR #12400.

This change necessarily affects a lot of files. In general I found it preferable to cut along the FDB <-> tenant boundary, rather than try to cut tenant into multiple pieces, stitch the Frankenstein tenant implementation back together with FDB, and generally remove the limbs one by one. So it is a single big deletion.

Note that some tenant-related metadata has been written in a non-flag-controlled manner by prior releases and probably must be ignored indefinitely. Fortunately this is isolated to include/fdbclient/ClientLogEvents.h. (Details: deleting an Optional from a serialized struct results in deserialization of garbage in upgrade tests. The serialized nullopt to indicate "no Tenant" is formally part of FDB persistent metadata even in FDB clusters that never would have enabled the tenant feature.)

During the course of testing these changes, many interesting bugs were encountered. I won't discuss details of them here. Causes range from flat out damage (by me) to production code in the course of removing tenant related bits (mainly in NativeAPI.actor.cpp and CommitProxy.actor.cpp), damage to various workload files (particularly FuzzApiCorrectness.actor.cpp, which is very sensitive to changes), and many toml files needing updated test flags/options.

More testing details: https://quip-apple.com/Zr6VAycxoli9

20251209-012852-gglass-8ff850b772d868f2 compressed=True data_size=35311687 duration=21671404 ended=500000 fail_fast=1000 max_runs=500000 pass=500000 priority=100 remaining=0 runtime=2:31:30 sanity=False started=500000 stopped=20251209-040022 submitted=20251209-012852 timeout=5400 username=gglass

* remove some unneeded tests, and remove mentions of deleted tests from tests/CmakeLists.txt

* Initiate removal of metacluster. NOTE: this seems to also want removal of tenant. Consider removing them together.

* work on removing metacluster

* delete files with `Tenant` in the name, having reviewed them to ensure that they basically contain what the name implies

* fdb_c.h: remove prototypes for C API methods which have been deleted (blob granule) or which are so long deprecated that they are outside any reasonable/documented support window

* Surgical removal of tenant references from files in bindings/ top level directory.  Compilation not yet attempted.

* Surgical removal of tenant related stuff from fdbcli/ top level directory.  Compilation not yet attempted.

* Misc tenant code removal, and other stuff which I think may not be needed.  Compilation still not attempted.

* Remove more tenant or tenant-adjacent or blob-granule-adjacent stuff.  Or at least stuff that looks adjacent to that stuff.  Not compiled or tested.

* Start removing Tenant stuff from fdbclient/.  Far from complete.  Compilation not attempted.

* Remove tenant references from many source files.  There are still about 7 principal fdbclient/ and fdbserver/ files with a lot of tenant logic left to delete. Also, all of fdbserver/workloads needs to be looked at.  Still have not attempted compilation.

* Remove tenant entanglement from watch functionality

* Remove tenant stuff from fdbserver/tester.actor.cpp

* Delete metacluster workloads

* Remove tenant related stuff from workloads.  Also taken the liberty of removing some functionality that appears unused or untestable by Apple.

* Checkpoint tenant removal from FuzzApiCorrectness.actor.cpp

* NativeAPI.actor.cpp: `Tenant` has left the building.

* SimulatedCluster.actor.cpp: `Tenant` has left the building

* DDShardTracker.actor.cpp: Tenant evicted

* storageserver.actor.cpp: `tenant` has left the building.

* fdbserver/workloads/FuzzApiCorrectness.actor.cpp: remove tenant references, but some lingering cleanup needed in `loadAndRun`

* FileBackupAgent.actor.cpp: tenant has left the building

* CommitProxyServer.actor.cpp: remove tenant

* Remove more tenant references from misc files such as bindings tests, documentation, and some fdbserver headers I left earlier

* Fix missing-file errors in CMakeLists.txt files.  This is the first attempt to compile this stuff.

* checkpoint misc changes to fix compile errors

* checkpoint more compile fixes

* StorageServerInterface.h: put back more verify() calls

* More misc compile fixes

* whole bunch of misc fixups including some code put-backs to address compile errors

* More compile fixes

* More compile fixes.  Still does not compile.

* incremental compile fixing

* ...

* ...

* Checkpoint a bunch of compile fixes.  Not quite there but getting closer

* More compile fixes.  There seem to be about 10 files left, mainly CommitProxyServer.actor.cpp and storageserver.actor.cpp

* IT COMPILES NOW.  THIS IS STILL ALL UNTESTED.  Unsurprisingly, CommitProxyServer.actor.cpp and storageserver.actor.cpp took the most tweaking.

The updates in CMakeLists.txt and workloads/UnitTests.actor.cpp are basically trivial and mainly reflect
the ordering of dependencies -- that stuff didn't get attempted until all of fdbserver compiled.

* Put back one block relating to encryption at rest mode.  Simplify some TODO(gglass) instances.

* Put back some encryption related knobs

* remove `enable_tenants` from local_cluster.py to maybe fix some ctests

* Remove tenant related options from toml files.

* feature-status.md: add a line for encryption at rest, which seems to have been added for multi-tenant; status is now in doubt

* Fix a pretty bad bug introduced in tenant deletion; ensure we dont attempt to construct a std::string of negative length

* workloads/FuzzApiCorrectness.actor.cpp: avoid division by zero

* flow/Platform.actor.cpp: add a try/catch wrapper around side threads; emit a better addr2line type command

* NativeAPI.actor.cpp: fix a bug introduced in tenant removal relating to reporting conflicting keys under conflictingKeysRange

* ReportConflictingKeys.actor.cpp: separate an ANDed assert into two asserts

* SpecialKeySPaceCorrectness.actor.cpp: put back some logic removed with tenant removal.  This test was failing due to a bug with conflict key range reporting.  Fixed separately in NativeAPI.actor.cpp.

* remove QuotaCommand.actor.cpp

* Force disable tenant and encryption on disk in upgrade tests

* Add back file I guess I deleted?  who knows

* put back another file

* design/feature-status.md: update the new row for encryption at rest to firm up the claim that it is experimental, unowned, and scheduled for deletion

* Remove EncryptKeyProxyTest since we do not use it

* new file tests/slow/BulkDumpingS3WithChaos.toml: remove tenantModes setting

* Undo damage to pushToBackupMutations() from removing tenant feature.  This caused inverted_range errors and failed commits in backup related simulations.

* tests/restarting/from_7.4.0/Snap*-1: ensure that tenantModes = disabled

* Try again on workloads/FuzzApiCorrectness.actor.cpp

* simplify tenant-free (mostly) FuzzApiCorrectness workload code

* try harder to remove lingering tenant-related brokenness from FuzzApiCorrectness.actor.cpp

* Explicitly specify tenantModes = ['disabled'] in all the -1 restart files

* Remove tenantModes from 7.1-based upgrade tests as its an unknown option.  Hopefully the code doesnt actually turn on tenant stuff

* do not specify tenantModes in downgrade tests

* Downgrade test to_7.4.5: dont say tenantModes

* more tenantModes updates

* Remove a legacy allowDefaultTenant that no longer is meaningful in downgrade to 8.0

* Put back empty Optional<TenantName> turdlets into serialized log events to avoid breaking ClientTransactionProfilingCorrectness upgrade tests (even with tenantMode = disabled)

* disable encryption on a few more upgrade related test cases.  That feature is slated for removal anyway

* Remove unneeded workload files that have been subject to #if 0 for a while. Remove commented out block in ClusterRecovery

* disable encryption in more upgrade tests

* Remove choice four-letter words from commentary

* Format 42 files

* Try to fix a doc bug failing the CI build

* More doc compilation error fixes

* Delete more tenant junk from documentation

* fix spelling mistake in comment

* Remove deleted cross-references from documentation.  This necessitated editing release 3.0.0 release notes, which is insane.

* Remove more tenant stuff from bindings tests

* Remove more tenant bits from design/ files

* Remove more tenant related stuff

* Delete more tenant references.  Put back ten-ant spellings as tenant now that grep output is substantially reduced.

* Put back some tenant stuff into apitester; its deletion seems to have introduced bugs.  Also whine about comments some more, because, really, the comments deserve it.

* Updates to workload files and one other thing based on review comments

* de-actorify decodeKVPairs

* format one source file

* Restore transaction tagging doc

* Restore throttle doc details in administration.rst

* Restore fdbserver/workloads/GetEstimatedRangeSize.actor.cpp and associated toml file, minus tenant stuff

* bindings/c/test/{shim related}: update comments and disable functionality that no longer works post-tenant

* put the cli-throttle tag back in

* bindingtester: fix python syntax errors

* remove useless comment

* Remove comment about useless comments, and remove the useless comments
2025-12-09 12:39:41 -08:00
Jingyu Zhou f746140e60
Refactor clusterRegisterMaster to be invoked inline and remove registerMaster RequestStream (#12553)
* Refactor clusterRegisterMaster to be invoked inline

Previously the master is driving the recovery and needs an RPC to tell cluster
controller changes. Now recovery is already on CC and thus can be simplified.

20251114-055844-jzhou-295f029a1da6f46b

* Remove RequestStream registerMaster

No longer needed

20251114-060723-jzhou-772636a37bc8470b
2025-11-14 15:14:53 -08:00
Vishesh Yadav d6f5e4e8d7 Remove running gRPC service in simulation 2025-11-05 18:22:44 -08:00
Vishesh Yadav 614ca9937e Synchronously use gRPC->Stop() in simulation 2025-11-05 18:22:44 -08:00
Vishesh Yadav 48d9e90d89 Add `fdbctl` library and ControlService gRPC Service
'fdbctl' aims to implement control plane layer for FoundationDB.
This includes general operations related to cluster management,
getting service health etc. This is all exposed via ControlService
with interface described in 'control_service.proto'.

Eventually 'fdbcli' and 'ControlService' can both reuse 'fdbctl'
in library much of what 'fdbcli' does is within scope of this
component.
2025-11-05 18:22:44 -08:00
Vishesh Yadav d3ec06b201 Fix macOS build 2025-10-31 13:05:36 -07:00
Vishesh Yadav 72d2e96b24 Make gRPC server and lifecycle part of worker interface
Also addresses some issues around TLS and initialization. The service
is started only if gRPC addresses are provided during startup.
2025-10-31 13:05:36 -07:00
gxglass 668450f22e
Delete Storage Cache Server feature (#12486)
* Initiate deletion of storage cache feature.  This is rough and is mostly done by commenting out code in case backtracking is needed.  Compiles.  Not tested.

* fix some test errors about cache consistency check options which we no longer care about

* design/feature-status.md: Storage Cache status updated to `has been deleted`.

* Delete it for real

* disable BackupS3BlobCorrectness.toml because it fails a lot

* In the interest of a single-purpose, clean diff, put back a removed dumb warning that generates compile error noise

* fix formatting

* Add TODO comment to remove tagLocalityLogRouter

* fix typo
2025-10-21 15:04:39 -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
gxglass b1d6dcf0e7
Delete blob granule feature (#12435)
This is the first experimental feature to be deleted in the list published at PR #12400.

There is more code here than I anticipated. It is about 40,000 lines total, of which about three quarters are in dedicated files which I am deleting, and about one quarter is in shared files. That means about 10k lines in shared files, which is the stuff we tend to notice day to day (that plus the test failures on heretofore not-yet-disabled test cases, which I am now deleting).

I ran 3 million simulations, mostly against 692df86 or very similar code (differing by one TraceEvent). This was prior to syncing with upstream/main, which had no conflicts and from which I don't expect problems. The number of failures in these runs was about 8. We looked at them and believe there is a high likelihood that these are existing issues not related to the changes in this PR. More details on these failures can be found in docs linked from here: https://quip-apple.com/MN7gAyXLjgyn

* change Long Term status for unowned features for "scheduled for deletion" where applicable

* Relax wording about scheduled for deletion features

* Delete blob granule feature.  WIP.  Does not compile.

* more incremental hacking to remove / comment out blob granule related code

* more hacking to remove blob granule related code, e.g. blob manager and blob migrator roles

* delete more blob granule stuff

* more hacking

* more hacking

* more hacking

* More changes to remove blob granule related code.  IT COMPILES NOW

* dont try to run AuthzSecurity tests as we have deleted that workload as part of this effort

* delete more stuff that matches, abbreviates, or smells like blob granule related

* EncryptKeyProxy: dont do blobMetadata stuff, because that is not used and support is being removed

* delete more references to blob granule stuff

* SimulationConfig::setEncryptionAtRestMode: always use DISABLED; also disable EncryptKeyProxyTest.toml

* format code

* manual update to bindings/java/src/tests.cmake to remove a deleted file

* fix compile errors.  I guess by default I dont build Java bindings

* remove unneeded blob granule functions rather than #if..#endif them out

* remove more code in #if..#endif

* remove more code in #if 0..#endif

* revert changes to fdb_c.h in preparation for marking removed API calls as removed

* rework C API declarations to in preparation for marking blob granule APIs as removed

* deprecate removed glob granule related API functions as of version 740 (and add a comment to request a justification of this convention)

* make progress on broken ctests.  E.g. 1) python does not need to do blob granule stuff.  2) authz tests seemingly not needed

* remove blob granule stuff from Java and Python APIs and fix test runner stuff so that ctests pass

* reformat comments to fix compile error.  FIXME: why is this error not happening on the default compile commands we use

* hacks all the way down to try to fix the Mac build

* add pointed comment about the perceived pointlessness of the API deprecation scheme embodied in this source file

* really serious about the C++ style comments, arent we

* remove commented-out code from prior iterative efforts

* put back undeleted code in original order

* delete commented-out code

* update feature-status.md to say blob granule is mostly deleted

* upgrade `mostly deleted` to `has been deleted`
2025-10-13 16:18:56 -07: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
gxglass 7246d10455
Misc cleanups and comment updates from reading code (#12280)
* Remove code which has been behind #if 0 for > 5 years

* Separate open() from read() failures, and avoid potentially leaking fds

* Minor refactor to remove some distracting #ifdefs

* Add comment

* Add some META-FIXME comments about suspicious dated FIXME comments.
Also add one long straight up FIXME comment about a commented out code block
that looks suspicious.  Discuss other ways that the code in question could be structured.

* Add a link to a doc page describing DEBUG_DETERMINISM

* Format updates

* Save 2 lines of code

* Remove useless comment

* Remove long-commented out code; remove useless comments; request a comment

* Remove obvious comments; request comments about non-obvious stuff

* Request comments explaining protocols

* Comment updates

* Rename tlog-spilling.md.html to tlog-spilling.md so that github renders it

* Remove broken link

* Revert "Remove broken link"

This reverts commit 6f90eff6ce.

* Revert "Rename tlog-spilling.md.html to tlog-spilling.md so that github renders it"

This reverts commit b57a922489.

* Remove broken link and unnecessary assertion about required background; add an explanation for why the user is reading raw markdown

* Update provisional comment, and remove long-commented out code which we think is not necessary.

* Add one small explanatory comment

---------

Co-authored-by: Gideon Glass <gglass_glass@apple.com>
2025-07-31 10:05:44 -07:00
Jingyu Zhou 701a5e7631
Refactor: some duplicated code patterns found by teamscale (#12154) 2025-05-15 21:15:17 -07:00
Zhe Wang a3abfad67a
reduce ShouldCheckPeer frequency and increase max_trace_lines for bulkload tests (#11935) 2025-02-10 17:59:03 -08:00
Syed Paymaan Raza 26f38c8970
Gray failure observability (#11923) 2025-02-06 17:16:14 -08:00
Jingyu Zhou df0fc7d3b8
Fix issues with clang 19 (#11834)
* Fix issues with clang 19

* Fix format

* Ignore --undefined-version for gcc
2024-12-13 14:20:45 -08:00
Zhe Wang f6be4a4b94 bulkdump generate global manifest 2024-12-03 22:01:07 -08:00
Syed Paymaan Raza 7a5f61cc65
Address feedback in PR #11753 (#11757) 2024-11-05 20:30:40 -08:00
Syed Paymaan Raza 84fb8f843c
Gray failure allows storage servers to complain (#11753) 2024-11-05 16:53:02 -08: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 80ca71833b Make xxhash checksum the default for TLog
Update downgrade tests to use the xxhash.
2024-09-17 12:46:42 -07:00
Jingyu Zhou 43dd7595c5 Remove old tlog 4.6, 6.0, and 6.2
These are unsupported versions now.
2024-09-17 12:46:42 -07:00
Syed Paymaan Raza 48064f6cf1
Make some codeprobes rare (#11607)
* Make BlobGranule code probes rare

* Make encryption related code probes rare

* fixup! Fix formatting
2024-08-26 22:33:38 -07:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Zhe Wang 0b3bc71689
Fix TraceTooManyLines in BulkLoading Simulation Test (#11531)
* fix-trace-too-many-lines-bulkload-test

* mute PeerHealthMonitor

* address comments
2024-07-26 17:47:34 -07:00
Jingyu Zhou a733e48048
Merge pull request #11517 from jzhou77/release-notes
Fix Wunused-but-set-variable warnings
2024-07-18 13:51:21 -07:00
Jingyu Zhou 078aaf153c
Merge pull request #11497 from xis19/4846
Add PeerAddress to all PeerAddr/Peer TraceEvent
2024-07-18 10:09:57 -07:00
Jingyu Zhou d9e4c49503 Fix more -Wunused-variable warnings 2024-07-17 15:35:49 -07:00
Xiaoge Su cf70d45e6d Add PeerAddress to all PeerAddr/Peer TraceEvent
This is to address #4846
2024-07-09 16:49:22 -07:00
Zhe Wang e9505506df
add consistency-check-urgent-mode to tester process class (#11484) 2024-07-09 13:21:37 -07:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Jingyu Zhou f72eab118d Skip redwood for clearInflightCommits unit test
Redwood complains DB is invalid for this unit test:

Assertion keyProvider.isValid() || db.isValid() failed @ /root/src/foundationdb/fdbserver/VersionedBTree.actor.cpp 8029:
2023-09-18 14:34:36 -07:00
Jingyu Zhou 977851fa39 Fix sharded rocks failure by adding a shard 2023-09-13 15:53:27 -07:00
Jingyu Zhou 42df53b3bc Add a test case for storage engine
This test validates that in-flight commit to the storage engine is properly
handled. As found in https://github.com/apple/foundationdb/pull/10714, an
engine could misses in-flight data and cause data corruptions.

The test case is modeled after the above corruption: insert data, then clear
the data in the next commit to the storage engine, and finally varify that the
data is cleared.
2023-09-13 15:25:25 -07:00
Yi Wu 3287098b4a EaR: Handle KMS timeout in storage server and commit proxy 2023-08-28 16:17:43 -07:00
Zhe Wang f8311ae069
Add more trace event for TSS recruitment (#10809)
* add more trace event for tss

* update StorageServerInitProgress

* add more traces
2023-08-23 09:19:30 -07:00
Zhe Wang 83dc9ff6f7
Trace SS init progress (#10799)
* trace ss init progress

* improve trace events
2023-08-18 18:44:37 -07:00
Zhe Wu 2078a0055a Add documentation 2023-07-26 14:16:16 -07:00
Zhe Wu f9c3ac3704 Remove debugging logging 2023-07-26 12:35:19 -07:00
Zhe Wu e583deddfe Apply format 2023-07-26 11:21:20 -07:00
Zhe Wu 00cdf09966 Cluster controller monitors recovery stats and trigger recovery if current recovery contains degraded servers 2023-07-17 11:14:22 -07:00
Zhe Wu 9670ed1cd8 Make TLog explicitely monitor connectivity issue during [start version, recover version] recovery 2023-07-17 11:12:28 -07:00
Zhe Wu 458d210584 Add an option in worker to force detect connectivity issue to other transaction workers in primary region 2023-07-17 11:12:28 -07:00
Yi Wu 92fc089eb0
FDBCORE-5211: Fix worker server handleIOErrors heap-use-after-free (#380) (#10555) 2023-06-26 16:35:33 -07:00