Commit Graph

518 Commits

Author SHA1 Message Date
Trevor Clinkenbeard 23b972297b
Merge pull request #13213 from tclinkenbeard-oai/dev/tclinkenbeard/apply-fdb-ast-grep-rules
More AST-grep linting
2026-05-26 14:53:10 -07:00
Trevor Clinkenbeard 38517a86f2 Avoid clearing shared DB in mapped range Java test 2026-05-21 09:03:46 -07:00
Michael Stack 738a6dce6f
Retry transient failures in Java integration test lifecycle methods (#13235)
066978d6ef added retry handling to the test *methods* in
MappedRangeQueryIntegrationTest by letting FDB errors propagate through
Database.run() instead of catching them as assertion failures. However,
the test still fails in CI because the transaction timeout can also fire
in the @BeforeEach/@AfterEach clearDatabase() calls and in the
RequiresDatabase.beforeAll() health check — neither of which had any
retry logic.

The CI failure shows 22 tests passing then the container failing: this
means beforeAll() succeeded but a clearDatabase() call (likely @AfterEach
on the last test) timed out under CI load. The stack trace shows
FDBTransaction.onError() itself timing out, confirming the transaction
timeout was exhausted with no retry budget remaining.

Fix all three sites:

- RequiresDatabase.beforeAll(): increase timeout from 100ms to 5s and
  retry up to 10 times with 500ms backoff. The original 100ms was too
  tight for a cluster that may still be bootstrapping on loaded CI.

- MappedRangeQueryIntegrationTest.clearDatabase(): retry the clear
  operation up to 5 times with 1s backoff.

- RangeQueryIntegrationTest.clearDatabase(): same fix (identical pattern).
2026-05-18 14:46:52 -07:00
Michael Stack 882a341179
Reduce MappedRangeQueryIntegrationTest record count to fix CI flakiness (#13217)
The MappedRangeQueryIntegrationTest frequently times out in CI
(transaction_timed_out error 1031) because the test inserts 10,000
records (40,000 keys) which can exceed the 5s transaction timeout
when the CodeBuild instance is under heavy load from concurrent
compilation and other tests.

Reduce numRecords from 10,000 to 1,000. This still validates the
mapped range query functionality (1,000 records with 3 splits each
= 4,000 keys, querying 100 at a time) while completing well within
the transaction timeout on loaded infrastructure.
2026-05-13 16:12:36 -07:00
Trevor Clinkenbeard 73fc36e935 Apply explicit constructor cleanup from ast-grep 2026-05-13 08:38:45 -07:00
Trevor Clinkenbeard 066978d6ef Retry transient failures in mapped range Java integration test 2026-05-10 17:29:01 -07:00
Trevor Clinkenbeard d010cf0a87 Remove generated Java TODO comments 2026-04-28 10:22:19 -07:00
Trevor Clinkenbeard 79a2d23ce9
Replace NULL with nullptr in cpp files (#12803) 2026-03-19 09:13:41 -07:00
Aditya kumar singh 801c49a15d
Add getCommittedVersionAsPrimitive() to avoid autoboxing overhead (#12787) 2026-03-18 21:38:07 -07:00
Trevor Clinkenbeard e7737f7bf6 Enforce new rules 2026-03-14 02:25:26 +00:00
Trevor Clinkenbeard 652f85de07
Add and enforce more `readability-*` `clang-tidy` rules (#12765)
* Add and enforce more readability-* clang-tidy rules

* Revert readability-else-after-return changes
2026-03-12 22:30:38 -07:00
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
Vishesh Yadav fc60c2f221
Bump FoundationDB version to 8.0.0 (#12510)
* Bump FoundationDB version to 8.0.0

* Remove restarting tests for older versions

* Bump PREV to 7.4.5 as 7.4.0 release binaries are missing

* Update protocol version templates

* Ignore couple fdb_c config tests

Expects to miss an API function, but recent two versions don't
have any new API functions. Although, we have removed some in
current version.

* Add 8.0 to transaction_profiling_analyzer
2025-10-28 19:28:46 -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
Michael Stack dd2eb53758
foundationdb-pr-macos-m1 on macOS Ventura 13.x fails downloading jar (#12101) 2025-04-24 14:44:05 -07:00
Jingyu Zhou df94b7f2f8
Fix Javadoc build error, RPM packaging, and Dockerfile (#12084)
* Fix Javadoc build error

The API version is hard coded.

* Update RHEL7 to RHEL9 for packaging

* Fix docker build
2025-04-16 13:44:43 -07:00
Syed Paymaan Raza 6319330d8e Revert "Update main branch to 8.0 (#11968)"
This reverts commit 710f3f3083.
2025-02-28 13:31:40 -08:00
Syed Paymaan Raza 710f3f3083
Update main branch to 8.0 (#11968) 2025-02-26 14:09:52 -08:00
Jon Chambers 0aeff16dfd Make `ByteArrayUtil#EMPTY_BYTES` public 2024-12-28 17:53:07 +08:00
Jingyu Zhou d7ceecbd47
Fix java lib missing symbols issue (#11836)
Clang19 doesn't like missing symbols
2024-12-13 20:00:26 -08:00
Eloi Démolis 4848aeba2b
Rust external workload modifications (#11805)
* Rust external workload modifications

- add readme
- add simulation configuration file
- minor Rust bindings changes
- fix FDBPerfMetric::format_code default value in the C++ bindings
- Add CWorkload.c to CMake
- Fix cpp_workload test file

---------

Signed-off-by: Eloi DEMOLIS <eloi.demolis@clever-cloud.com>
2024-12-04 15:43:20 -08:00
Eloi Démolis e77f304fa0
C workload bindings (#11288)
* C workload bindings

Signed-off-by: Eloi DEMOLIS <eloi.demolis@clever-cloud.com>
2024-11-20 13:22:28 -08:00
Syed Paymaan Raza 392bad2bd3
More copyright end year updates (#11556) 2024-08-05 14:00:32 -07:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
hao fu 6b782c10f6 Fix globalconfig refresh hang issue
CC sets a version to int_max in ClientDBInfo indicating a refresh, however,
proxy server would reject this version for the error of future_version.

This change fixes this issue by not sending int_max, instead maintaining a
lastKnown in memory and send it to grvproxy to get latest globalconfig.

this change also fixes some java tests that were used to test the fix
2024-05-14 15:40:03 -07:00
Tom Parker-Shemilt 6452b701c5 Fix various Javadoc comments that break the doc build 2024-02-19 19:10:00 -06:00
Tom Parker-Shemilt 2f623f985d Add javadoc build 2024-02-19 19:10:00 -06:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Oleg Samarin 1cb0a860da Added more javadoc information for com.apple.foundationdb.LocalityUtil.getAddressesForKey
(cherry picked from commit af51830eafef881f6bfd880b17982ea62f7823c2)
2023-07-10 11:04:27 +03:00
Zhe Wu 5c8a163c72
Update main branch to 7.4 (#10459)
* Update main branch to 7.4

* Update API version to 740

* Makes fdb_c_client_config_tests.py passing after API version update

* Remove from_7.3.0_until_7.4.0 and add from_7.3.0

* Update tests in fdb_c_client_config_tests.py
2023-06-15 10:19:39 +02:00
Aaron Molitor a718a31dd7 update links to foundationdb.org to reference GitHub 2023-05-30 10:15:20 -05:00
Vaidas Gasiunas 9bc55f67c3
Fix releasing watches on future cancellation (#10304)
* Test watch cleanup on cancel

* Fix clearing the database in Java integration tests

* Always cancel the futures wrapped by MVC abortable futures

* More tests for watch cleanup

* Fix clear database database in some Java integration tests
2023-05-22 22:01:27 +02:00
Vaidas Gasiunas d16d53739e Some more tests for future cancelations in Java bindings 2023-05-12 20:43:18 +02:00
Vaidas Gasiunas 574a4cec71 Remove debugging output in future cancellation tests 2023-05-12 16:20:54 +02:00
Vaidas Gasiunas 6594c4d302 Java binding: Fix reentrant locking in future cancelation 2023-05-12 15:58:38 +02:00
Vaidas Gasiunas 607a1040ed Testing future cancelation in Java bindings with an external client 2023-05-12 15:57:45 +02:00
Zhe Wu e3490a1af8 Update API version to 730 2023-05-10 11:26:46 -07:00
Hao Fu 3158f8b033
Fix hashCode() and equals() for MappedKeyValue (#10170) 2023-05-08 16:54:11 -07:00
A.J. Beamon 95cf9948a1 Add API version protection for the change to use a default option for used during commit protection in Java 2023-05-03 16:18:11 -07:00
hao fu 29161b2fda Revert matchIndex feature
It is not protocol compatible, revert it to avoid deployment issue.
Will have a new PR to have the feature if moving forward.
2023-04-17 09:39:45 -07:00
Markus Pilman 5bebb5b4aa
Merge pull request #9492 from sfc-gh-vgasiunas/vgasiunas-api-version-defs
Centralize definition of API Version for Java, Python and C API
2023-02-28 12:04:02 -07:00
Russell Sears d02118db67 Add support for using pre-downloaded junit dependencies 2023-02-27 15:38:58 -06:00
Vaidas Gasiunas 8a934c4f93 Fix comment in TestApiVersion 2023-02-27 18:30:50 +01:00
Vaidas Gasiunas e3b3bf9307 Fix formatting in TestApiVersion 2023-02-27 18:27:42 +01:00
Vaidas Gasiunas 83f76b60b9 Define the API version separately for the Java tests that are not executed as a part of the CI 2023-02-27 18:20:11 +01:00
Vaidas Gasiunas 8ddda99036 Fix name of FDB_USE_LATEST_BINDINGS_API_VERSION 2023-02-27 16:53:35 +01:00
Vaidas Gasiunas 1b6ced1a09 Define latest C API version in one place 2023-02-27 15:13:56 +01:00
Vaidas Gasiunas 7f35b395d3 Define the latest Java bindings API version in one place 2023-02-27 11:53:01 +01:00
Vaidas Gasiunas 402f618180
Default transaction options for report_conflicting_keys and used_during_commit_protection_disable (#9441)
* Introducing default transaction options for report_conflicting_keys and used_during_commit_protection_disable, set the latter option always in Java bindings

* Reformatting TransactionIntegrationTest.java

* Update description of transaction_report_conflicting_keys option

* Remove dependency between mock and real database implementation in RangeQueryTest.java

* Update generated.go after changing desciption of an option

* Small improvements of the TransactionIntegrationTest code
2023-02-23 18:05:01 +01:00