Commit Graph

48 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
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
Sreenath Bodagala bfe0b4e535
Extend consistency checkers to be compatible with version vector (#12405)
* - Extend consistency checker code to be compatible with version vector

* - Resolve a compilation related error, and add a comment

* - Code review related changes
2025-10-03 13:41:51 -04:00
Syed Paymaan Raza 392bad2bd3
More copyright end year updates (#11556) 2024-08-05 14:00:32 -07:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Zhe Wang 55c023a815
Improve visibility of consistency checker (#11018)
* improve visibility consistency checker

* fix for CI failure
2023-10-24 13:21:07 -07:00
Josh Slocum 0e6216e926
fix per-scan-loop throttling to properly throtte in the loop (#10502) 2023-07-10 13:02:12 -04:00
Josh Slocum 356d0030a4
fixed consistency scan corruption check when worker is hard-killed in the middle, and improved debugging for stuck consistency scan (#10516) 2023-06-22 11:54:08 -05:00
Josh Slocum 01ce1ab24d
fix consistency scan ubsan issue and replication factor calculation (#10492) 2023-06-15 08:10:49 -05:00
Hui Liu 630013cfd9
Fix MoveKeysClean.toml failure (#10470) 2023-06-13 08:45:03 -07:00
Josh Slocum 31e4610b56
misc operational and documentation improvements (#10465)
* misc operational and documentation improvements

* fixing doc build
2023-06-12 15:14:01 -05:00
Josh Slocum b209cd5d19
Consistency scan polish (#10445)
* added operational metrics and some polish

* moving consistency scan enablement in simulation tests to main tester workflow

* more stats and throttling polish
2023-06-08 14:18:58 -05:00
Josh Slocum 220b7d1a37
Consistency scan test improvements (#10402)
* adding consistency scan clear stats and testing in simulation

* Adding test that intentionally injects corruption in consistency scan requests and ensures the scan finds it

* cleanup

* adding assert false to disabled code
2023-06-07 07:21:47 -05:00
Josh Slocum f9a6b54863
Correctly throttling consistency check on error case (#10412) 2023-06-06 13:12:40 -05:00
Josh Slocum 2344a419bd
fixing consistency scan loop and completion check (#10345)
* fixing consistency scan loop and completion check

* fixing ide build
2023-05-25 18:29:03 -05:00
He Liu 8ad7ec6fdf
Psm ss (#9817)
* Update NativeAPI getCheckpointForRange().

* Implemented checkpoint in SS.

* clean up.

* Disabled StorageServerCheckpointTest.

* Serialized checkpoint creation and deletion.

Simplified checkpoint GC, via deleting CheckpointMetaData::dir.

* Fixed PhysicalShardMove test. Where fetchCheckpoint target range is misset.

* Minor improvements on CheckpointMetaData and DataMoveMetaData.

* fmt.

* Optimized PhysicalShardMove test

cleanup.

* Refactored ShardedRocks checkpoint/restore for psm.

* Complete ShardedRocks::restore.

* dismiss operation_obsolete, and throw actor_cancelled.

* Validate checkpoint when !asKeyValues.

* fmt.

* Don't read from uninitialized physical shard.

* Resolved commments.

* cleanup.

* Added verify_checksum_before_restore for ShardedRocks.

* Added ShardedRocksDB checkpoint/restore unit test.

* Populate CheckpointMetaData::dir in RocksDB.

* Rename MovingIn as Adding.

* Added StorageServerUtils.

* Added physical shard move in SS.

* Fix on ApplyMetaData, doFetchFile error handling etc.

* Debugging incorrect shard size.

* Create/delete checkpoints only when Physical shard move is enabled.

* Added back SHARD_ENCODE_LOCATION_METADATA.

* Fixed bytesSample incorrect issue.

Essentially dedicated CheckpointRocksDBCF as key-value based checkpoint, will need to add a new format for the file-based checkpoint.

* Cleanup.

* Cleanup & compile rocksdb with 8.1 branch.

* clean up.

* clean up.

* Allowed request_maybe_delivered error type in FetchShard.

* Added FDBRocksDBVersion.h.

* Fixed stuck fetchShard.

* Don't create checkpoint on TSS.

* Upgrade to RocksDB 8.1.1

* Cleanup.

* Fixed accidently deleted db_path and name fields.

* Improved trace event.

* Removed redundants from previuos ShardedrocksDB.

* Cleanup.

* cleanup.

* cleanup.

* reanme `state`.

* Cleanup.

* Removed excessive TraceEvent.

* * Fixed shardMap race condition on different threads
* Added *Stats, logging data move rates.
* Added `DD_PHYSICAL_SHARD_MOVE_PROBABILITY` to support hybrid data move.

* Resolved comments.

* fmt.

* Use physical shard move in PhysicalShardMoveTest.

* Enforce physical-shard-move for PhysicalShardMoveTest.

* fmt
2023-05-23 11:18:35 -07:00
Yanqin Jin 2951fe7033 Fix 2023-05-19 15:23:37 -07:00
Jingyu Zhou 58999e493f Also check storage servers are in different DCs 2023-05-18 16:57:58 -07:00
Jingyu Zhou c2e30d3829 format code and remove an unused variable 2023-05-18 15:00:18 -07:00
Jingyu Zhou b1d0e9c578 Merge branch 'main' of https://github.com/apple/foundationdb 2023-05-18 14:42:35 -07:00
Josh Slocum 2916a11a86
New ConsistencyScan (#10265)
* Remove duplicate getRange() for DB handles and update existing GetRange to accept DB handles.

* Initial progress checkpoint on new ConsistencyScan role.

* Updated TODOs, finished most if not all state updates.

* placeholder

* Add more TODOs, documentation and comment improvements.

* Checkpoint round state to avoid advancing progress if commit fails.

* Bug fix, check is supposed to be for overlap, not lack of overlap.

* Added more TODO's and added faked read results / exceptions and faked DB size retrieval to prove the consistencyScanCore logic works.

* Update JSON schemas and command help.

* Add comment about lifetime stats reset.

* More TODO comments and some renames for clarity, some bug fixes.

* properly stopping consistency scan in simulation so that it doesn't run forever and cause quiet database to fail

* removing trailing comma from consistency_scan json schema

* Making CC inconsistency not an error if it's intentional tss corruption

* consistency scan actually reads storage locations

* added check that consistency scan actually completes a round in simulation, fixed bug and added debugging around consistency scan getting stuck

* made consistency scan properly fetch database size

* refactoring data check to be used in both consistency scan and consistency check

* checking that consistency scan always completes at least one round and doesn't get stuck

* cleanup

* fixing ide build

* consistencyscan fdbcli command wasn't actually changing db state

* consistencyscan fdbcli command always said enabled even when it wasn't

---------

Co-authored-by: Steve Atherton <steve.atherton@snowflake.com>
2023-05-18 15:02:41 -05:00
Jingyu Zhou eff338f7bd Fix ConsistencyCheck_DataInconsistent failure in simulation
In the KillRegion workload, a force recovery can intentionally kill a region
and recover from another region with data loss. It's possible that when the
ConsistencyScan (CS) role is checking a shard from two storage servers, the
one from the failed region returned first for a higher version, then the SS
was killed. Later, CS got data from the second SS from a different region,
where forced recovery rollback happened and a lower version value was returned.
In this case, even though the data is inconsistent, we shouldn't fail the test.

Reproduction:
  commit: 8e0c9eab8 on release-7.3 branch
  seed: -f ./tests/fast/KillRegionCycle.toml -s 2713020850 -b on
  build: gcc
2023-05-17 22:52:11 -07:00
Evan Tschannen c8e8505101
buggified max_shards_on_large_teams (#10105)
* buggified max_shards_on_large_teams, and had the consistency scan verify the proper number of shards have been overreplicated

* fix: when restarting the data distributor, do no allow more than max_shards_on_large_teams shards to be marked as healthy
2023-05-08 16:56:42 -07:00
Jingyu Zhou 5e8feac8c9 Fix ConsistencyCheck_InvalidShardSize due to unfair split
ConsistencyCheck thinks the shard is too large and should be split. However, it
is possible that the split point returned by the Storage Server is discarded
due to "unfair" sizes after the split. Fix this problem by checking if this is
the case in ConsistencyCheck.
2023-04-28 11:35:05 -07:00
Steve Atherton 858b51a69b Address review comments. KeyRangeMapSnapshot is now ReferenceCounted and getSnapshot() returns a Reference to discourage copying. Added several comments for clarity. Added FormatUsingTraceable and changed all new formatters to use it except for Standalone<T> which redirects to the formatter for T. 2023-04-24 19:01:05 -07:00
Steve Atherton c57ed25987 Renamed SystemDBLockWriteNow() to SystemDBWriteLockedNow() and changed definition to be more direct / clear. 2023-04-22 13:17:41 -07:00
Steve Atherton 639d4d05ef Removed SYSTEM_PRIORITY_IMMEDIATE from KeyBackedTypes and all options from KeyBackedRangeMap database functions. Added SystemTransactionGenerator<> for wrapping Database types and generating transactions with selected system level options. 2023-04-21 19:00:29 -07:00
Steve Atherton ebb3c8d698 Apply clang-format, debug output changes. 2023-04-18 22:21:27 -07:00
Steve Atherton bc6b9cb83f Added toJSON for DD Range configuration. 2023-04-18 22:21:27 -07:00
Steve Atherton 53ee26d758 Changed KeyBackedTypes to an actor file. Added TypedKeySelectors for Map and Set classes and getRange() keySelector methods. Added debug macro for KeyBackedTypes. Rewrote KeyBackedRangeMap using keyselectors on KeyBackedMap. 2023-04-18 22:21:19 -07:00
Steve Atherton b7e68bbf51 DDConfiguration class for modeling user specified key range configuration options. Added KeyBackedRangeMapSnapshot, some other supporting changes to KeyBackedTypes. Added invalidKey to give KeyBackedTypes a safe prefix to avoid accidental userspace modification from uninitialized accessors. 2023-04-18 22:09:18 -07:00
Dan Adkins 02f0a44987
Avoid divide-by-zero in isKeyValueInSample. (#9799)
In the pathological case that both key size and value size are 0,
the probability of choosing that key-value pair is 0, and we divide
by zero when computing the sampledSize.

This change adds documentation to that function, which was quite
difficult to understand. In addition, we add `probability` to the
returned values, since one of the callers was backing it out from
sampledSize and itself in danger of dividing by zero.
2023-03-24 16:05:26 -04:00
Evan Tschannen a258d775c3
Merge pull request #9710 from sfc-gh-etschannen/feature-custom-dd
Added the ability to manually create a shard and also increase its replication factor
2023-03-20 15:35:10 -07:00
A.J. Beamon dc2bd78aa7 The consistency check should retry if it couldn't find all the commit proxies when getting key server locations 2023-03-17 12:00:47 -07:00
Evan Tschannen de7f40d2f4 made a variety of improvements that came from code review 2023-03-17 10:30:34 -07:00
Evan Tschannen ac54962533 code cleanup 2023-03-16 09:47:21 -07:00
Evan Tschannen aaf7b9b32b Added the ability to manually create a shard and also increase its replication factor 2023-03-15 11:26:15 -07:00
Evan Tschannen 4a17ed363a Fix: the consistency check did not properly report failed tests 2023-03-08 16:56:23 -08:00
Jingyu Zhou 496b29aa3c
Update fdbserver/ConsistencyScan.actor.cpp 2023-01-23 09:34:04 -08:00
Jingyu Zhou 78838f1c74 Fix a consistency scan infinite looping
If a storage server was removed, the consistency scan may be looping forever,
because "request_maybe_delivered" was not handled.
2023-01-14 09:33:00 -08:00
A.J. Beamon 3e9b6ce937 Don't disallow a seed value of 0 2022-12-02 15:32:34 -08:00
A.J. Beamon 304747d387 The simulator was changing the configuration of the cluster while the consistency check was expecting a quiescent database 2022-11-03 08:35:34 -07:00
Jingyu Zhou c127bb1c30 Fix some clang warnings on unused variables 2022-11-01 15:38:47 -07:00
Xiaoxi Wang bb0236433c
Merge pull request #8540 from sfc-gh-xwang/feature/main/storageMetrics
Make MockStorageServer serve StorageMetrics related request
2022-10-25 17:29:21 -07:00
Xiaoxi Wang 3c67b7df39 extract serveStorageMetricsRequests template function 2022-10-24 09:58:41 -07:00
Vishesh Yadav aa99b89d53 Don't fail ConsistencyCheck on first mismatch
ConsistencyCheck fails when it sees the first corrupted shard. We may want to
keep it running so that we can see all the corrupted data in logs.
2022-10-21 17:02:02 -07:00
Sreenath Bodagala e83229ed8b
- Version vector specific: Propagate the latest commit version, as (#8393)
part of the read request, when reading from a storage server.
2022-10-05 16:23:56 -04:00
sfc-gh-ngoyal 1bd97fe628
Recruit new singleton for consistency checker. (#5804)
* Recruit new singleton for consistency checker.

* Recruit the consistency checker only if enabled.

* Add a yield in monitorConsistencyChecker().

* Minor fixes.

* Consistency check workload enhancements.

* Minor fixes and clarifications.

* clang format

* Clang format.

* Minor fixes, cleanup, debug tracing.

* Misc.

* Move the consistency scan information from dbconfig to a key backed object.

* Move consistency scan config out of db cofig to a state object and feature rename.

* ConsistencyCheck workload refactor.

* devFormat

* Update fdbcli/ConsistencyScanCommand.actor.cpp

* Review Comments.

Co-authored-by: negoyal <neelam.goyal@gmail.com>
Co-authored-by: Ata E Husain Bohra <ata.husain@snowflake.com>
2022-09-16 09:03:06 -07:00