Files
apple-foundationdb/documentation/sphinx/source/api-error-codes.rst
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

177 lines
23 KiB
ReStructuredText

.. _developer-guide-error-codes:
Error Codes
===========
FoundationDB may return the following error codes from API functions. If you need to check for specific errors (for example, to implement custom retry logic), you must use the numerical code, since the other fields are particularly likely to change unexpectedly. Error handling logic should also be prepared for new error codes which are not listed here.
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| Name | Code| Description |
+===============================================+=====+================================================================================+
| success | 0| Success |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| operation_failed | 1000| Operation failed |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| timed_out | 1004| Operation timed out |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| transaction_too_old | 1007| Transaction is too old to perform reads or be committed |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| future_version | 1009| Request for future version |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| not_committed | 1020| Transaction not committed due to conflict with another transaction |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| commit_unknown_result | 1021| Transaction may or may not have committed |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| transaction_cancelled | 1025| Operation aborted because the transaction was cancelled |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| transaction_timed_out | 1031| Operation aborted because the transaction timed out |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| too_many_watches | 1032| Too many watches currently set |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| watches_disabled | 1034| Watches cannot be set if read your writes is disabled |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| accessed_unreadable | 1036| Read or wrote an unreadable key |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| process_behind | 1037| Storage process does not have recent mutations |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| database_locked | 1038| Database is locked |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| cluster_version_changed | 1039| Cluster has been upgraded to a new protocol version |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| external_client_already_loaded | 1040| External client has already been loaded |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| proxy_memory_limit_exceeded | 1042| CommitProxy commit memory limit exceeded |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| batch_transaction_throttled | 1051| Batch GRV request rate limit exceeded |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| operation_cancelled | 1101| Asynchronous operation cancelled |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| future_released | 1102| Future has been released |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| tag_throttled | 1213| Transaction tag is being throttled |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| platform_error | 1500| Platform error |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| large_alloc_failed | 1501| Large block allocation failed |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| performance_counter_error | 1502| QueryPerformanceCounter error |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| io_error | 1510| Disk i/o operation failed |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| file_not_found | 1511| File not found |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| bind_failed | 1512| Unable to bind to network |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| file_not_readable | 1513| File could not be read |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| file_not_writable | 1514| File could not be written |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| no_cluster_file_found | 1515| No cluster file found in current directory or default location |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| file_too_large | 1516| File too large to be read |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| client_invalid_operation | 2000| Invalid API call |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| commit_read_incomplete | 2002| Commit with incomplete read |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| test_specification_invalid | 2003| Invalid test specification |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| key_outside_legal_range | 2004| Key outside legal range |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| inverted_range | 2005| Range begin key larger than end key |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| invalid_option_value | 2006| Option set with an invalid value |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| invalid_option | 2007| Option not valid in this context |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| network_not_setup | 2008| Action not possible before the network is configured |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| network_already_setup | 2009| Network can be configured only once |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| read_version_already_set | 2010| Transaction already has a read version set |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| version_invalid | 2011| Version not valid |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| range_limits_invalid | 2012| Range limits not valid |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| invalid_database_name | 2013| Database name must be 'DB' |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| attribute_not_found | 2014| Attribute not found in string |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| future_not_set | 2015| Future not ready |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| future_not_error | 2016| Future not an error |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| used_during_commit | 2017| Operation issued while a commit was outstanding |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| invalid_mutation_type | 2018| Unrecognized atomic mutation type |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| transaction_invalid_version | 2020| Transaction does not have a valid commit version |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| no_commit_version | 2021| Transaction is read-only and therefore does not have a commit version |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| environment_variable_network_option_failed | 2022| Environment variable network option could not be set |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| transaction_read_only | 2023| Attempted to commit a transaction specified as read-only |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| invalid_cache_eviction_policy | 2024| Invalid cache eviction policy, only random and lru are supported |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| network_cannot_be_restarted | 2025| Network can only be started once |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| blocked_from_network_thread | 2026| Detected a deadlock in a callback called from the network thread |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| incompatible_protocol_version | 2100| Incompatible protocol version |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| transaction_too_large | 2101| Transaction exceeds byte limit |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| key_too_large | 2102| Key length exceeds limit |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| value_too_large | 2103| Value length exceeds limit |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| connection_string_invalid | 2104| Connection string invalid |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| address_in_use | 2105| Local address in use |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| invalid_local_address | 2106| Invalid local address |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| tls_error | 2107| TLS error |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| unsupported_operation | 2108| Operation is not supported |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| too_many_tags | 2109| Too many tags set on transaction |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| tag_too_long | 2110| Tag set on transaction is too long |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| too_many_tag_throttles | 2111| Too many tag throttles have been created |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| special_keys_cross_module_read | 2112| Special key space range read crosses modules. |
| | | Refer to the ``SPECIAL_KEY_SPACE_RELAXED`` transaction option for more details.|
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| special_keys_no_module_found | 2113| Special key space range read does not intersect a module. |
| | | Refer to the ``SPECIAL_KEY_SPACE_RELAXED`` transaction option for more details.|
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| special_keys_write_disabled | 2114| Special key space is not allowed to write by default. Refer |
| | | to the ``SPECIAL_KEY_SPACE_ENABLE_WRITES`` transaction option for more details.|
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| special_keys_no_write_module_found | 2115| Special key space key or keyrange in set or clear does not intersect a module. |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| special_keys_cross_module_write | 2116| Special key space clear crosses modules |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| special_keys_api_failure | 2117| Api call through special keys failed. For more information, read the |
| | | ``0xff0xff/error_message`` key |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| api_version_unset | 2200| API version is not set |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| api_version_already_set | 2201| API version may be set only once |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| api_version_invalid | 2202| API version not valid |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| api_version_not_supported | 2203| API version not supported |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| exact_mode_without_limits | 2210| EXACT streaming mode requires limits, but none were given |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| unknown_error | 4000| An unknown error occurred |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+
| internal_error | 4100| An internal error occurred |
+-----------------------------------------------+-----+--------------------------------------------------------------------------------+