Commit Graph

1857 Commits

Author SHA1 Message Date
Jingyu Zhou e7fd3eda00 Revert "Update fdbclient/NativeAPI.actor.cpp"
This reverts commit 812243bafa.
2022-10-27 19:46:05 -07:00
Steve Atherton f9ad7fb35b Merge origin/main into storageserver-pml 2022-10-27 18:00:11 -07:00
Xiaoge Su 812243bafa Update fdbclient/NativeAPI.actor.cpp
Co-authored-by: Jingyu Zhou <jingyuzhou@gmail.com>
2022-10-27 12:42:05 -07:00
Xiaoge Su 41d1d6404d Remove debugging output 2022-10-27 12:42:05 -07:00
Xiaoge Su 4bd24e4d64 Record the version of each watch
In the case
    1. A watch to key A is set, the watchValueMap ACTOR, noted as X, starts waiting.
    2. All watches are cleared due to connection string change.
    3. The watch to key A is restarted with watchValueMap ACTOR Y.
    4. X receives the cancel exception, and tries to dereference the counter. This causes Y gets cancelled.

the reference count will cause watch prematurely terminate. Recording
the versions of each watch would help preventing this issue
2022-10-27 12:42:05 -07:00
Xiaoge Su 639afbe62c Cancel watch when the key is not being waited
Currently, there is a cyclic reference situation in

    DatabaseContext -> WatchMetadata -> watchStorageServerResp ->
    DatabaseContext

If there is a watch created in the DatabaseContext, even the
corresponding wait ACTOR is cancelled, the WatchMetadata will still hold
a reference to watchStorageServerResp ACTOR, which holds a reference to
DatabaseContext.

In this situation, any DatabaseContext who held a watch will not be
automatically destructed since its reference count will never reduce to
0 until the watch value is changed. Every time the cluster recoveries,
several watches are created, and when the cluster restarts, the
DatabaseContext which not being used, will not be able to destructed due
to these watches.

With this patch, each wait to the watch will be counted. Either the
watch is triggered or cancelled, the corresponding count will be
reduced. If a watch is not being waited, the watch will be cancelled,
effectively reduce the reference count of DatabaseContext. This will
hopefully fix the issue mentioned above.

The code is tested by 1) Manually change the number of logs of a local
cluster, see the cluster recovery and previous DatabaseContext being
destructed; 2) 100K joshua run, with 1 failure, the same test will fail
on the current git main branch.
2022-10-27 12:42:05 -07:00
Steve Atherton 56abec32f1 Bug fix: The change feed request UID is actually not just for debugging and can't be shared across requests, so the debugID in ReadOptions should not be used. Restored the original ChangeFeedRequest member but renamed it from debugUID to just id. 2022-10-26 20:45:39 -07:00
Steve Atherton fb44945a89 Use id variable to simplify logic a bit. 2022-10-26 17:35:39 -07:00
Dennis Zhou deeedfc3f8
Merge pull request #8537 from sfc-gh-dzhou/unblob
blob: allow purge ranges to begin and end in unblobbified regions
2022-10-26 11:11:09 -07:00
Steve Atherton c2cacb4123 Added ReadOptions and read lock support support to ChangeFeed requests and used its DebugID to replace the streamUID. Refactored read lock and read options usage in Storage Server to simplify code and handle ReadOptions to Priority conversion in a single place, fixed a few bugs along the way. Set CacheResult to False for requests created by fetchKeys(). 2022-10-26 01:32:45 -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 36d9de9072 change UNREACHABLE to ASSERT(false); change function name 2022-10-25 15:43:24 -07:00
Dennis Zhou 474955b10d blob: allow purge as long as it doesn't start in a range 2022-10-24 11:08:04 -07:00
Dennis Zhou 48d6e725c2 blob: convert listBlobbifiedRangesActor() to take a Transaction 2022-10-24 11:08:04 -07:00
Dennis Zhou 07f1247885 blob: getBlobRanges() use transaction instead of RYWTransaction 2022-10-24 11:08:04 -07:00
Dennis Zhou dd52d997ba blob: rename rowLimit variable for listBlobbifiedRanges() 2022-10-24 11:08:04 -07:00
Xiaoxi Wang e07a50573a splitStorageMetrics finish implementation (no unit test yet but 100k
test pass)
2022-10-24 09:58:41 -07:00
Xiaoxi Wang 1603926595 refactoring old waitStorageMetrics and finish MGS::waitStorageMetrics
(no unit test yet)
2022-10-24 09:58:41 -07:00
Xiaoxi Wang 70eb9aef28 simple MGS IKeyLocationService implementation 2022-10-24 09:58:41 -07:00
sfc-gh-tclinkenbeard 32ae7bb529 Merge remote-tracking branch 'origin/main' into expose-txn-cost 2022-10-23 12:59:07 -07:00
sfc-gh-tclinkenbeard b442705dc7 Change units for tag quota enforcement from pages to bytes 2022-10-23 12:57:19 -07:00
sfc-gh-tclinkenbeard da4ceaf735 Improve code coverage for proxy-level transaction tag throttling 2022-10-23 10:39:59 -07:00
sfc-gh-tclinkenbeard 1ae98808f9 Retry on proxy_tag_throttled errors 2022-10-23 09:56:30 -07:00
Steve Atherton e5a5ec36a4 Merge commit '0872cbfb2f00886817f18584d95af217e28ad51d' into storageserver-pml
# Conflicts:
#	fdbserver/storageserver.actor.cpp
2022-10-19 13:25:31 -07:00
sfc-gh-tclinkenbeard 92bbcebed9 Increase trState->totalCost by one with each clear 2022-10-18 14:05:46 -07:00
Josh Slocum 89519343a7
adding new bg read metrics to client and refactoring them into a new trace event (#8493) 2022-10-18 14:13:35 -05:00
Jingyu Zhou 1b2fcdd4f6
Merge pull request #8053 from sfc-gh-akejriwal/getsizetenant
Make the storage metrics functions tenant aware
2022-10-17 20:02:52 -07:00
sfc-gh-tclinkenbeard 6251e8be32 Track transaction cost for range reads 2022-10-17 10:08:49 -07:00
Dennis Zhou 1c90fbbc61 blob: tenant verifyBlobRange() native api 2022-10-17 11:42:08 -05:00
Dennis Zhou 4a33de31e9 blob: tenant listBlobbifiedRanges() native api 2022-10-17 11:41:45 -05:00
Dennis Zhou 120b38a926 blob: tenant (un)blobbify() native api 2022-10-17 11:41:12 -05:00
Dennis Zhou 0ee0ce62f0 blob: blobGranuleGetTenantEntry() for tenant and database calls
Currently, blobGranuleGetTenantEntry() expects to get the TenantName
through the transaction. Database calls cannot abide by this contract.
So enable the call to take in a TenantName and expect at least 1 to be
set.
2022-10-17 11:41:12 -05:00
sfc-gh-tclinkenbeard 84aa815026 Implemented first version of Transaction::getTotalCost, along with workload 2022-10-16 21:58:08 -07:00
Ankita Kejriwal 0f9da9d1ad Merge branch 'main' of github.com:apple/foundationdb into getsizetenant 2022-10-14 16:50:51 -07:00
Ankita Kejriwal 854212fe94 Incorportate code review suggestions 2022-10-13 17:41:31 -07:00
Ankita Kejriwal be64b12ecf Clean up TraceEvents, TODOs, and simplify workload. 2022-10-13 14:31:42 -07:00
Jingyu Zhou df5825ff65
Merge pull request #8398 from sfc-gh-anoyes/anoyes/idempotency-id2
Initial work for automatic idempotency
2022-10-13 13:07:14 -07:00
hao fu 293cc2a8fb Each getRange request in a txn has a distinct trace id
Previously when multiple getRange requests are from the same parent
RL request, they share the same trace id from TransactionState, with
this change it has better granularity and makes it easier to compare
latency between getRange requests.
2022-10-12 12:12:58 -07:00
Josh Slocum 96574bacaa
Change Feed TSS Support (#8384)
* Change Feed TSS Support

* bug fixing for rare mismatch cases

* Adding rollback handling to tss change feed comparison
2022-10-12 10:23:51 -05:00
Ankita Kejriwal 3223208f0c Explicitly pass `arena` to the `withPrefix` function.
Also update some TraceEvents to be more succinct.
2022-10-11 18:35:01 -07:00
Andrew Noyes aad3899cb7 Enforce the lifetime of a write tx is actually <= MAX_WRITE_TRANSACTION_LIFE_VERSIONS 2022-10-11 13:46:39 -07:00
Andrew Noyes 045452aec8 Add more detail to TraceEvents 2022-10-11 13:46:39 -07:00
Andrew Noyes 6ef8d7ec95 Add AutomaticIdempotencyWorkload 2022-10-11 13:46:39 -07:00
Andrew Noyes f48d0d929b Assign to idempotency id through transaction options 2022-10-11 13:46:39 -07:00
Ankita Kejriwal 11658c7135 Merge branch 'main' of github.com:apple/foundationdb into getsizetenant 2022-10-11 13:09:47 -07:00
Ankita Kejriwal 12aaabb283 Fix bugs in finding correct shards for tenant aware storage metrics.
* Account for tenant in during cache invalidation in NativeAPI actor.
* Account for tenant prefix while checking whether a shard is readable
  on storage server.

This commit also adds many debug TraceEvents that will later be
removed.
2022-10-10 18:52:03 -07:00
Steve Atherton b7ce834d28 Merge commit '7c89cd705faee52d5d78e6c77665cb7cc4502f58' into storageserver-pml 2022-10-07 11:39:42 -07:00
Markus Pilman ea1325a552
Merge pull request #8319 from sfc-gh-tclinkenbeard/add-rare-code-probe-annotation
Add `rare` code probe decoration
2022-10-07 09:39:00 -06:00
Steve Atherton 3228afefd3 Unrevert #7578 - storage server PriorityMultiLock and PML rewrite. 2022-10-06 23:41:28 -07:00
A.J. Beamon f8186988bc
Merge pull request #8378 from sfc-gh-ajbeamon/tenant-support-for-database-switching
Add tenant support for database switching
2022-10-05 14:57:33 -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
Josh Slocum dc917453c1
Targeted blob granules fault injection (#8231) 2022-10-05 13:44:38 -05:00
A.J. Beamon 53593c77ac When updating watches after a database switch, lookup the tenant again to get the ID on the new cluster. Update the switching test to set up tenants properly. 2022-10-03 09:24:13 -07:00
Ankita Kejriwal de90e1aab1 Improve the code in the actors and server, simplify the workload 2022-09-29 18:34:35 -07:00
Ankita Kejriwal f63934117d Make the storage metrics function tenant aware [WIP]
This change makes the getEstimatedRangeSizeBytes function tenant aware.
Previously, this function would return the size of the requested
keyspace even if the tenant in the Transaction or DatabaseContext did
not match the tenant corresponding to the keyspace.

Also make some improvements to the new workload.
2022-09-29 18:32:04 -07:00
A.J. Beamon c8bb15e8ee
Merge pull request #8216 from sfc-gh-ajbeamon/backup-support-for-tenants
Include tenant and metacluster metadata in backups
2022-09-28 12:00:24 -07:00
sfc-gh-tclinkenbeard 985958c260 Add rare code probe decoration 2022-09-25 15:28:32 -07:00
Markus Pilman 5774249e5b
Revert "[DRAFT] Redwood PriorityMultiLock enable different launch limits to be specified based on different priority level." 2022-09-23 12:22:47 -06:00
Josh Slocum f78eb8c778
Adding bg read amp metrics (#8275) 2022-09-22 16:31:27 -07:00
A.J. Beamon fda0d7223d Update backup to include system key ranges needed for tenants. Run simulated backup tests with tenants. 2022-09-22 10:00:13 -07:00
Steve Atherton 04b4960786 Merge branch 'main' into fzhao/RedwoodIOLaunchLimit
# Conflicts:
#	fdbserver/VersionedBTree.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/ReadWrite.actor.cpp
2022-09-22 00:39:51 -07:00
Jon Fu 7a09b701cc
Merge pull request #8141 from sfc-gh-jfu/network-disable-bypass
Introduce network option for disabling mvc bypass
2022-09-21 17:33:48 -07:00
Dennis Zhou 4ea4546cb6 blob/java: verifyBlobRange() with latestVersion 2022-09-21 14:07:16 -07:00
Dennis Zhou e353169a50 blob: teach purge about latestVersion
This teaches purgeBlobGranules about latestVersion and rejects
versions <= 0.
2022-09-21 14:04:58 -07:00
Jon Fu 4e8ac6c811 remove network option on native side since option is no longer being forwarded 2022-09-20 11:10:12 -07:00
Jon Fu 1f778f9d76 Merge branch 'main' of github.com:apple/foundationdb into network-disable-bypass 2022-09-20 09:30:53 -07:00
Josh Slocum 0f3f493c28
Merge pull request #8218 from sfc-gh-jslocum/aligned_purge
fixes for non-aligned blob range calls
2022-09-19 15:00:02 -05:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
Josh Slocum 88f88707f5 fixes for non-aligned blob range calls 2022-09-16 19:06:15 -05:00
Jon Fu 1abac8ea9f check on shared state ptr in native api and add to test spec in api tester 2022-09-16 15:11:33 -07:00
Trevor Clinkenbeard 7b4598a53d
Merge pull request #8197 from sfc-gh-jslocum/bg_code_coverage_cleanup
cleaning tss and blob granule file code probes
2022-09-16 09:32:20 -07:00
Josh Slocum 4ead9a697f cleaning tss and blob granule file code probes 2022-09-16 09:51:33 -05:00
Josh Slocum 977c03ff78 not counting end of stream as an error for change feeds 2022-09-15 17:37:52 -05:00
Fuheng Zhao ac65c3f569 merge upstream main 2022-09-15 14:19:19 -07:00
Jon Fu 7b0285a205 attempt to pass sim tests and api tests 2022-09-15 11:02:28 -07:00
sfc-gh-tclinkenbeard 82adc1e856 Make g_simulator a pointer 2022-09-15 09:00:33 -07:00
Jon Fu a7956f42a4 add version guard and add network option to testConfig 2022-09-14 13:15:24 -07:00
Josh Slocum 3e5e49b635 Operational improvements to limit thundering herd effect of many change feed queries being retried simultaneously 2022-09-14 09:57:21 -05:00
Josh Slocum e5eabbf3df Additional observability for change feeds 2022-09-14 09:55:15 -05:00
Fuheng Zhao ee99de7cf3
Merge branch 'apple:main' into RedwoodIOLaunchLimit 2022-09-12 10:58:12 -07:00
Jon Fu f6d6aa719f initial commit to introduce network option for disabling mvc bypass 2022-09-09 14:29:38 -07:00
Jon Fu 006fc9a0ef code formatting 2022-09-09 11:58:36 -07:00
Jon Fu 75a096a5e5 Merge branch 'main' of github.com:apple/foundationdb into jfu-tenant-special-key-space 2022-09-09 10:12:19 -07:00
A.J. Beamon 726d5215a0
Remove API 720 guards for tenants (experimental feature) and the cluster ID special keys (#8108)
* Remove API 720 guards for tenants (experimental feature) and the cluster ID special keys (no need to guard)

* Enable the relaxed special key access in transactions that need to use special key-space APIs introduced in 7.2
2022-09-08 17:22:36 +02:00
Vaidas Gasiunas b6fb1034a9
Fix crashes on database create errors (#8115)
* ApiTester: enable access to database instances in workloads

* ApiTester: Inject database create errors

* Fix getClusterProtocol and database shared object initialization in case of database create errors

* Check deferred error in all Thread-Safe API calls returning a future

* ApiTester: disable injection of database create errors for tests with old versions
2022-09-08 09:21:51 +02:00
Xiaoxi Wang e836b743c0 Merge branch 'main' of https://github.com/apple/foundationdb into fix/main/grvError 2022-09-07 20:50:03 -07:00
Dennis Zhou 7fc4a92d09
Merge pull request #8089 from sfc-gh-jslocum/unblobbify_idempotent
Blob range idempotency test and fixes
2022-09-07 17:31:05 -07:00
Jon Fu da7ce5231c Merge branch 'main' of github.com:apple/foundationdb into jfu-tenant-special-key-space 2022-09-07 13:30:08 -07:00
Jon Fu 255795eac0 update test workload and reserve space for vector copies 2022-09-07 13:25:38 -07:00
Xiaoxi Wang 9fe12a256b catch grv_proxy_memory_limit_exceeded in getConsistentReadVersion 2022-09-06 22:18:14 -07:00
Jon Fu dbb6357371 add conflict range tests and change tenant prefix code to work with RYW 2022-09-06 16:55:57 -07:00
Dennis Zhou b2ae592b51
Merge pull request #8082 from sfc-gh-vgasiunas/vgasiunas-api-version
ApiVersion: Small cleanups
2022-09-06 10:03:45 -07:00
Fuheng Zhao 105c4e5236
Merge branch 'apple:main' into RedwoodIOLaunchLimit 2022-09-06 09:38:06 -07:00
Fuheng Zhao 91219a4a28 sync 2022-09-06 09:37:00 -07:00
Vaidas Gasiunas 8ca8691837 ApiVersion: Minor clean ups 2022-09-05 10:42:42 +02:00
Trevor Clinkenbeard 3ce737b2fa
Merge pull request #8086 from sfc-gh-tclinkenbeard/mark-promisestream-send-nonconst
Mark `PromiseStream::send` non-const
2022-09-04 14:55:47 -07:00
Josh Slocum 94e0c83214 Blob range idempotency test and fixes 2022-09-02 15:53:06 -05:00
sfc-gh-tclinkenbeard 3dec9749d3 Mark PromiseStream::send non-const 2022-09-02 10:41:56 -07:00
Josh Slocum 2251ae0fc2
Added summarize blob granules c api and tests (#8076)
* Added summarize blob granules c api and tests

* addressing review comments

* format
2022-09-02 17:08:51 +02:00
Dennis Zhou 80a0816157
flow: switch from hard coded to ApiVersion like ProtocolVersion (#8071)
* flow: add ApiVersion to replace hard coding api version

Instead of hard coding api value, let's rely on feature versions akin to
ProtocolVersion.

* ApiVersion: remove use of -1 for latest and use LATEST_VERSION
2022-09-02 09:28:13 +02:00
Fuheng Zhao c7f7544231 Merge remote-tracking branch 'upstream/main' into RedwoodIOLaunchLimit 2022-09-01 14:53:11 -07:00
Fuheng Zhao 61233123b2 format 2022-09-01 11:26:32 -07:00
Josh Slocum 663b1b9711 Handling request_maybe_delivered in reply promise stream and injecting faults to make sure the code path is exercised 2022-09-01 12:57:09 -05:00
Fuheng Zhao 0aa096dc17 sync with upstream main 2022-08-31 15:46:39 -07:00
Dennis Zhou 046141b5be blob: only allow unblobbification on aligned to ranges
If unblobbify request comes in, reject it if the start and end do not
align to a blob granule boundary.
2022-08-31 09:23:33 -07:00
Dennis Zhou dc27c9bbd7 blob: add basic pagination to listBlobbifiedRanges() 2022-08-31 09:23:33 -07:00
Steve Atherton 557efa1b53
Merge pull request #7406 from sfc-gh-fzhao/RedwoodDataMovementNonCacheRead
Redwood add non-cache reads options
2022-08-30 17:25:05 -07:00
Josh Slocum 269d54b7ad
One additional case for new error, and dropping retry limit for upgrade test back down (#8041) 2022-08-30 11:01:18 -05:00
Josh Slocum d90cdcc498
Adding new retryable error type for blob granule requests (#8023) 2022-08-30 15:07:10 +02:00
Josh Slocum 5f9d8e94af
Adding future_version reply to change feed operations for behind ss (#8000) 2022-08-29 17:20:23 -05:00
Sreenath Bodagala f257b6c2d0
- Consider logging a trace event in "DatabaseContext::getLatestCommitVersions" (#8008)
only if the version vector doesn't have an entry for a tag.
- Address a bug in "run_custom_cluster.sh" (Note: code change provided
by Dan).
2022-08-29 09:22:34 -07:00
Evan Tschannen 8314e80371
Fixed a few bugs which caused ratekeeper to unnecessarily throttle a cluster (#8006)
* do not count recently created change feeds for throttling

* fix: blocked assignments were not decremented when force purging

* fix: created needs to be updated when the changefeed is reset

* added asserts to detect if ratekeeper is throttled on blob workers
2022-08-26 15:38:31 -07:00
Josh Slocum 46b02cab49
Blob granule summary implementation (in native client) (#7981)
* implemented blob granule summary call in native client

* clean up prints
2022-08-26 14:04:59 -05:00
Jon Fu 337a2f8130 try to account for errors in fuzzapicorrectness and add test case in special key test 2022-08-25 15:28:06 -07:00
Jon Fu ee707b8f87 initial commit for explicit tenant support in special key space 2022-08-25 12:44:10 -07:00
Fuheng Zhao e3c46ffeef change FDB_DEFINE_BOOLEAN_PARAM 2022-08-24 15:53:05 -07:00
Fuheng Zhao 7c6dbaf3cf update trState ReadOption to optional 2022-08-24 15:04:17 -07:00
Josh Slocum e04e3885b9
Adding BlobRange test (#7868)
* Adding BlobRange test

* refactored blobrange test to use new db functions, and fixed several bugs

* bug fixes for blob manager and verifyBlobRange

* More range unaligned fixes

* cleaning up test and disabling tests that don't work yet for now

* removing overzealous assert in blob manager

* more fixes for overzealous assert

* cleanup and renaming test

* adding chaos to blob ranges test
2022-08-24 11:30:37 -05:00
Fuheng Zhao 4e748d6bed use optional ReadOptions and RangeReadOptions in requests 2022-08-23 17:16:47 -07:00
Evan Tschannen 493771b6a8
Throttle the cluster if the blob manager cannot assign ranges (#7900)
* Throttle the cluster if the blob manager cannot assign ranges

* fixed a number of different bugs which caused ratekeeper to throttle to zero because of blob worker lag

* fix: do not mark an assignment as block if it is cancelled

* remove asserts to merge bug fixes

* fix formatting

* restored old control flow to storage updater

* storage updater did not throw errors

* disable buggify to see if it fixes CI
2022-08-23 13:33:46 -05:00
Josh Slocum 98a7ec1797
Blob Granules Cleanup (#7941)
* Cleaned up BlobGranule TODO + FIXMEs and addressed some

* popping feed at correct version

* blob worker taking over a granule will pop from where previous worker left off

* addressed fixme of blob worker not re-snapshotting from old change feed

* formatting

* more change feed popped fixes after pop updates

* Getting rid of change feed parallelism lock since it can cause deadlocks in fetching, and relying on full fetch lock

* New blob worker metric and fixing old one

* server-side popped checking still doesn't work because of pops at non-mutation versions

* format
2022-08-19 17:25:31 -07:00
Fuheng Zhao e69e93496b inherit readOptions passed from FetchKeys 2022-08-17 14:05:32 -07:00
Dennis Zhou 3d400cff64 blob: verifyBlobRange() c api 2022-08-16 13:29:23 -07:00
Dennis Zhou 1c2109dcbd blob: add rangeLimit to getBlobGranuleRanges() 2022-08-16 13:29:23 -07:00
Dennis Zhou 96f3dd67b0 blob: add listBlobbifiedRanges() api 2022-08-16 13:29:20 -07:00
Fuheng Zhao 07018eefe5 update parameter order 2022-08-16 13:16:38 -07:00
Dennis Zhou 5085c21d0d blob: check if blob range exists and fail accordingly 2022-08-15 16:25:36 -07:00
Dennis Zhou 736ef4f2c9 blob: move blobrange command implementation to native api 2022-08-15 16:25:36 -07:00
Markus Pilman eb16947860
Merge pull request #7844 from jzhou77/grv-error
Buggify GRV proxy to return errors and fix bugs found
2022-08-15 13:59:21 -06:00
Chaoguang Lin 3fed0456ca
Add an verify option for \xff\xff/worker_interfaces special keys (#7873)
* Add the verify option for \xff\xff/worker_interfaces

* Remove unused code

* update documentations

* update documentations

* solve comments from review

* update some of the comments to be more clear
2022-08-15 14:05:07 -04:00
Evan Tschannen a9d3c9f9b3
Added throttling when a blob worker falls behind (#7751)
* throttle the cluster when blob workers fall behind

* do not throttle on blob workers if they are not enabled

* remove an unnecessary actor

* fixed a compile error

* fetch blob worker metrics at the same interval as the rate is updated, avoid fetching the complete blob worker list too frequently

* fixed another compilation bug

* added a 5 second delay before bw throttling to prevent false positives caused by the 100e6 version jump during recovery. Lower the throttling thresholds to react much quicker to bw lag.

* fixed a number of problems

* changed the minBlobVersionRequest to look at storage server versions since this will be a lot more efficient

* fix: do not let desired go backwards

* fix: track the version of notAtLatest changefeeds for throttling

* ratekeeper now throttled blob workers by estimating the transaction per second throughput of the blob workers

* added metrics for blob worker change feeds

* added a knob to disable bw throttling

* fixed the transaction options in blob manager
2022-08-12 13:15:56 -07:00
Jingyu Zhou 8fb6d59e94 Use error_code_grv_proxy_memory_limit_exceeded
instead of error_code_proxy_memory_limit_exceeded
2022-08-12 11:36:17 -07:00
Jingyu Zhou ed1b7ef173 Add a client knob GRV_ERROR_RETRY_DELAY 2022-08-12 11:13:32 -07:00
Jingyu Zhou 317866fbbf Add retry in waitForCommittedVersion for GRV error response 2022-08-12 11:13:32 -07:00
Jingyu Zhou 970105f318 Client needs to handle proxy_memory_limit_exceeded error 2022-08-12 11:13:32 -07:00
Xiaoge Su 0326d53965 Split proxy_memory_limit_exceeded to commit/grv specific exceptions
Currently GRV is reporting proxy_memory_limit_exceeded error which has
error message claiming Commit proxy failing. This split should remove
such confusion.
2022-08-12 00:45:57 -07:00
Josh Slocum 7c155f4521
Granule force purging (#7846)
* Granule purge cannot delete history entry for fully deleting granule until all children are completely done splitting

* Several purging fixes related to granule history

* Fixed typo in refactor

* fixing memory model for purgeRange

* formatting

* weakening granule purge test for now

* cleanup

* First version of force purging granules

* fixing issue in BW range assignment reporting

* Fixing incorrect assert with force purging

* Error handling when checking force purged state

* fixed force purging and recover/reassign range races and check

* Handling force purge + boundary change race

* more places to check for force purged status

* fixed manager restart in the middle of force purge bug

* fixing same-BM purge and assignment races in all cases

* weakening orphaned granule history check a bit because of difficult to solve races

* fixing txn options on retry

* loading force purged ranges at start to avoid resuming a merge that is being force purged

* cleanup

* Enabling purging in granule tests, and adding check for leaked change feeds in force purge

* formatting

* missed parameter in merge conflicts

* Fixing leaked change feed race with merge and force purge

* adding change feed cleanup when new blob manager recovers in-progress merge that raced with force purge

* added forcepurge fdbcli command
2022-08-11 15:22:32 -07:00
Fuheng Zhao 28469196b5 add comments 2022-08-10 15:45:15 -07:00
Fuheng Zhao d24a52952c update readOption struct 2022-08-10 10:16:26 -07:00
Josh Slocum 735b78cd0c
Several Assorted Blob Granule/Change Feed bug fixes (#7842)
* fixing another actor cancelled callback issue in change feed stream

* remove wait for on move, to ensure stream can't read from a shard the SS no longer owns

* fixing key alignment after downsampling split

* Fixing out-of-date granule reporting itself as a merge candidate

* fix formatting
2022-08-10 08:28:09 -07:00
Fuheng Zhao 1a5b8fbd30 resolve conflicts 2022-08-09 09:57:11 -07:00
Fuheng Zhao e4fb565057 use readOptions to pass type and cacheResult 2022-08-08 15:30:56 -07:00
Markus Pilman 02b69e3c66
Merge pull request #7806 from sfc-gh-ajbeamon/fix-unknown-tenant-handling
When a transaction operation gets an unknown tenant error, it needs to reset the tenantID
2022-08-08 10:33:10 -06:00
Vaidas Gasiunas 79571dd2b4
Testing upgrades to a future version of FDB (#7780)
* Enable configuring the next future protocol version as the current protocol version in FDB client, fdbserver, and fdbcli

* Auto format python files used in upgrade tests

* Add a test for upgrading to a future FDB version

* Emphasize that the options for using future protocol version are intended for test purposes only

* Make the global variable for current protocol version visible only locally

* Refactirng to avoid using currentProtocolVersion() in static intialization

* Update go bindings
2022-08-08 17:29:49 +02:00
A.J. Beamon 17858cf8a0 When a transaction operation gets an unknown tenant error, it needs to reset the tenant ID so it can be updated in the next tenant lookup request. 2022-08-06 13:13:46 -07:00
Josh Slocum ddbf32d35e
adding knob and fixing blobrange cli check bug with too many granules (#7793) 2022-08-05 11:19:17 -05:00
Fuheng Zhao d5c3679046 merge upstream main and resolve conflicts 2022-08-04 12:15:00 -07:00
Fuheng Zhao dccf0c5fd7 add readType to other requests 2022-08-02 15:47:15 -07:00
A.J. Beamon 1b693a588a Merge branch 'main' into feature-metacluster 2022-08-01 14:43:14 -07:00
A.J. Beamon ea76eb2beb Transactions could change tenant ID part way through. The dummy transaction could set a new tenant ID but use the old tenant prefix. 2022-07-30 16:16:18 -07:00
A.J. Beamon e8e4f3ad3a Merge branch 'main' into feature-metacluster
# Conflicts:
#	fdbclient/include/fdbclient/Tenant.h
2022-07-28 16:53:29 -07:00
Dan Lambright 83d23512d2
Track when version not found in version vector. (#7653)
* Track when version not found in version vector.

* Respond to comments

* include vv in event

* Respond to review comments.

* Fix bug where we logged too many lines
2022-07-28 18:26:15 -04:00
Junhyun Shim c6342a6e5b
Merge branch 'main' into features/authz 2022-07-27 20:51:32 +02:00
Junhyun Shim 27e2bf60c6 Handle case where exception is thrown before tenant prefix is prepended 2022-07-27 20:13:25 +02:00
A.J. Beamon 7c6b3fb0b8 Merge branch 'main' into feature-metacluster 2022-07-27 08:55:10 -07:00
Josh Slocum 77956dc7ae
Merge pull request #7639 from sfc-gh-jslocum/cf_metadata_rewrite
Change Feed Metadata Rewrite and adding targeted fault injection
2022-07-26 18:10:37 -05:00
Junhyun Shim 5169616b16 Fix unresolved merge conflicts 2022-07-27 00:38:16 +02:00
Junhyun Shim e2a3fedfc7
Merge branch 'main' into features/authz 2022-07-27 00:08:57 +02:00
Josh Slocum 8b5b7a9b92
Merge pull request #7689 from sfc-gh-jslocum/purge_fixes
Granule Purge Fixes
2022-07-26 17:02:24 -05:00
Josh Slocum ba31229797 addressing review comments 2022-07-26 16:37:06 -05:00
Junhyun Shim 6f9c87f2a5 Move dummy transaction flag to TransactionState
Also add more description of what the flag does and when it's set
2022-07-26 23:27:46 +02:00
A.J. Beamon 4c4eb3fc48
Merge pull request #7704 from sfc-gh-ajbeamon/add-comments-to-tenant-function
Add comments explaining the use of the TransactionState tenant() and hasTenant() functions
2022-07-26 14:01:50 -07:00
Junhyun Shim adc601e8a3 Simplify tenant-aware dummy transaction 2022-07-26 21:30:44 +02:00
A.J. Beamon d31324102d Add comments explaining the use of the TransactionState tenant() and hasTenant() functions 2022-07-26 10:17:57 -07:00
Fuheng Zhao 32ab7421e1 add readtype to requests 2022-07-26 10:12:54 -07:00
A.J. Beamon 7c2ed53aef Fix: during recovery, it was possible for tenant operations to briefly fail because the tenant mode is not known 2022-07-25 13:03:15 -07:00
Junhyun Shim 553e6aba75 Make dummy transaction commits tenant-aware
Dummy transaction commits are made when earlier transaction returned
commit_unknown_result or request_maybe_delivered, to affirm the status
of earlier transaction. Without tenant-awareness, these transactions
will fail due to lack of authorization in case of untrusted clients.
2022-07-25 18:20:37 +02:00
Josh Slocum ee1b0cdd43 making purge failures fail test 2022-07-23 13:10:03 -05:00
A.J. Beamon 41c1bef3bf Merge branch 'feature-tenant-groups' into feature-metacluster 2022-07-22 14:26:02 -07:00
Xiaoge Su 25d9fa856c fixup! Update code per comments 2022-07-21 23:14:31 -07:00
Xiaoge Su 32b4968835 Add TraceEvent to the construction/destruction of DatabaseContext
This is to figure out why huge databaseLogger related TraceEvents
generated after 7.1 released.
2022-07-21 19:38:59 -07:00
A.J. Beamon 3e1763e7ac Merge branch 'main' into feature-metacluster 2022-07-21 14:48:53 -07:00
A.J. Beamon 410f27412b
Merge pull request #7620 from sfc-gh-ajbeamon/make-tuple
Add a Tuple::makeTuple function to easily construct a tuple
2022-07-20 17:09:10 -07:00
A.J. Beamon fee131f24d
Merge pull request #7591 from sfc-gh-ajbeamon/key-backed-types-range-read-more
Add support for returning a more flag from key backed types' range reads
2022-07-20 15:57:50 -07:00
A.J. Beamon 279296c29f Merge branch 'tenant-metadata-change' into feature-metacluster
# Conflicts:
#	fdbclient/SystemData.cpp
#	fdbclient/Tenant.cpp
#	fdbclient/include/fdbclient/SystemData.h
#	fdbclient/include/fdbclient/Tenant.h
#	fdbclient/include/fdbclient/TenantManagement.actor.h
#	fdbserver/TenantCache.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
2022-07-20 09:18:27 -07:00
Josh Slocum fd9201f60b Merge branch 'main' into cf_metadata_rewrite 2022-07-20 07:55:00 -05:00
A.J. Beamon 537ceff8ac Remove the ability to configure a tenant subspace. Rename the prefixes used for tenant metadata. 2022-07-19 14:32:05 -07:00
A.J. Beamon 190ad8c7e9 Convert existing tuple usages to use Tuple::makeTuple() 2022-07-19 13:45:59 -07:00
Markus Pilman 1de37afd52
Make TEST macros C++ only (#7558)
* proof of concept

* use code-probe instead of test

* code probe working on gcc

* code probe implemented

* renamed TestProbe to CodeProbe

* fixed refactoring typo

* support filtered output

* print probes at end of simulation

* fix missed probes print

* fix deduplication

* Fix refactoring issues

* revert bad refactor

* make sure file paths are relative

* fix more wrong refactor changes
2022-07-19 13:15:51 -07:00
A.J. Beamon 3ceb2a0639 Merge branch 'main' into feature-metacluster 2022-07-19 13:04:54 -07:00
Fuheng Zhao 2322730345 fix issues related to terminate storage server 2022-07-19 11:19:30 -07:00
Dan Lambright 775ab3323e
update tag client cache on getKeyLocation (#7613) 2022-07-19 11:24:17 -04:00
Josh Slocum 2573c0018c cleanup after passing tests 2022-07-19 08:00:25 -05:00
Josh Slocum 4540e2879c Change Feed Metadata refactor to fix races, simplify model, and clean up code 2022-07-18 12:46:11 -05:00
Junhyun Shim ca29cd9f41 Make RequestStreams accept empty TenantInfo
+ Make Authz tokens survive Transaction resets
+ Make tokens explicitly resettable by assigning empty value to authz token TR option
+ Fill out missing trace for some failed token verifications
+ Trace non-sensitive token parts upon failed verification
2022-07-18 13:30:55 +02:00
Fuheng Zhao 312e160a12 use PriorityMultiLock in storage server 2022-07-14 15:29:54 -07:00
A.J. Beamon 30afc35439 Merge branch 'key-backed-types-range-read-more' into feature-metacluster 2022-07-13 16:00:01 -07:00
A.J. Beamon 91949439d2 Add support for returning whether a key-backed type range read has more results or not. 2022-07-13 15:46:10 -07:00
A.J. Beamon cb499fa5db Merge branch 'main' into feature-metacluster 2022-07-13 15:28:34 -07:00
Junhyun Shim 03a496c0e0 Make auth token survive transaction resets 2022-07-13 20:34:01 +02:00
Josh Slocum 0b0ac16a4c Merge branch 'main' into granule_merging 2022-07-12 09:09:30 -05:00
Markus Pilman 2edbcf2c65
Merge pull request #44 from apple/main
Merge main
2022-07-12 07:51:22 -06:00
Jingyu Zhou 58aa5a9e1d
Merge pull request #7539 from sfc-gh-fzhao/SetFetchKey
set isFetchKeys for getRangeStreamFragment
2022-07-11 13:25:24 -07:00
Junhyun Shim dbf8f98481 Apply Clang format 2022-07-11 17:10:45 +02:00
Junhyun Shim 61f3d14ec6 Add TokenCache test
Add function authz::jwt::TokenRef::toStringRef() for token tracing
Add StringRef::toStringView()
2022-07-11 13:42:41 +02:00
Markus Pilman 2ae17233d8 addressed review comments 2022-07-08 11:19:14 -06:00
Markus Pilman f268265d96
Apply suggestions from code review
Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
Co-authored-by: Junhyun Shim <junhyun.shim@snowflake.com>
2022-07-08 10:42:44 -06:00
He Liu bc5bfaffda
Shard based move (#6981)
* Shard based move.

* Clean up.

* Clear results on retry in getInitialDataDistribution.

* Remove assertion on SHARD_ENCODE_LOCATION_METADATA for compatibility.

* Resolved comments.

Co-authored-by: He Liu <heliu@apple.com>
2022-07-07 20:49:16 -07:00
Fuheng Zhao 207082f03e comment out setting isFetchKeys 2022-07-07 12:55:25 -07:00
Fuheng Zhao 6e7603aa35 set isFetchKeys for getRangeStreamFragment 2022-07-07 11:14:11 -07:00
A.J. Beamon 1519f24f77 Merge branch 'main' into feature-metacluster 2022-07-07 09:35:40 -07:00
A.J. Beamon c4b0f6eaae
Add an internal C API to support connection to a cluster using a connection string (#7438)
* Add an internal C API to support memory connection records

* Track shared state in the client using a unique and immutable cluster ID from the cluster

* Add missing code to store the clusterId in the database state object

* Update some arguments to pass by const&
2022-07-07 10:12:49 +02:00
Markus Pilman 56541167c2 send token with tenant info object 2022-07-06 20:58:17 -06:00
A.J. Beamon c9b553663e Merge branch 'main' into feature-metacluster
# Conflicts:
#	bindings/java/src/main/com/apple/foundationdb/TenantManagement.java
#	fdbcli/TenantCommands.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbclient/TenantSpecialKeys.actor.cpp
#	fdbclient/include/fdbclient/KeyBackedTypes.h
#	fdbclient/include/fdbclient/RunTransaction.actor.h
#	fdbclient/include/fdbclient/SpecialKeySpace.actor.h
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
2022-07-06 15:44:21 -07:00
A.J. Beamon 1e8225a19e
Merge pull request #7511 from sfc-gh-ajbeamon/add-subrange-support-to-tenant-special-keys
Update the tenant special keys submodule to support multiple sub-ranges
2022-07-06 10:33:14 -07:00
A.J. Beamon 2eae95aabe Merge branch 'main' into feature-metacluster 2022-07-01 14:07:34 -07:00
Sreenath Bodagala 037c06a688 Merge remote-tracking branch 'apple-upstream/main' 2022-07-01 04:51:17 +00:00
A.J. Beamon aea4d802c6 Merge branch 'main' into feature-metacluster 2022-06-30 15:08:09 -07:00
A.J. Beamon 2f67328a0c Update the tenant special keys submodule to support multiple sub-ranges. This will enable future work that allows configuring tenants at the same time as creating them. 2022-06-30 15:03:37 -07:00
Josh Slocum 48bcf6eaba
parameterizing min split size instead of hardcoding it to min_shard_bytes (#7404) 2022-06-30 12:28:22 -07:00
Sreenath Bodagala c74710f6d5 - Address a review comment
- Optiize out the code in DatabaseContext::getLatestCommitVersions()
in the case where the feature is turned off.
2022-06-29 10:13:08 +00:00
A.J. Beamon e1a93988ef Merge branch 'main' into feature-metacluster 2022-06-28 14:58:07 -07:00
Markus Pilman 9d16260822 Merge remote-tracking branch 'origin/main' into features/authz 2022-06-28 13:13:51 -06:00
sfc-gh-tclinkenbeard 086e4bff06 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-28 10:18:13 -07:00
Sreenath Bodagala 0da13a7797 - Optimize out the version vector specific code (on the client)
when the version vector feature is disabled.
2022-06-28 09:17:53 +00:00
Renxuan Wang 4452e53342 Fix a problem caused by missing state. 2022-06-27 23:52:54 -04:00
Xiaoxi Wang 62d4ac550a Merge branch 'main' of https://github.com/apple/foundationdb into feature/ddtxn 2022-06-27 11:35:22 -07:00
Markus Pilman 3aaae9c521 Merge remote-tracking branch 'origin/main' into features/authz 2022-06-27 11:07:14 -06:00
Markus Pilman 8af056e7b0 fdbclient now compiling 2022-06-23 18:05:36 -06:00
Markus Pilman ffaf15c12a moved wellknownendpoints and fixed some includes 2022-06-23 17:03:53 -06:00
Xiaoxi Wang a5054b2beb move getServerListAndProcessClasses to NativeAPI 2022-06-23 15:28:45 -07:00
Markus Pilman d35445a868 enforce include modularization in cmake 2022-06-23 14:37:35 -06:00
A.J. Beamon 9f3819752f Change the command to create a metacluster from using 'configure tenant_mode=management' to 'metacluster create <NAME>'. Distribute this name to all processes in a metacluster. Eliminate the tenant mode entirely from metacluster clusters, instead relying on a metacluster registration key. 2022-06-22 12:15:43 -07:00
sfc-gh-tclinkenbeard 2391e58fb2 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-21 10:09:15 -07:00
sfc-gh-tclinkenbeard bcd8785767 Remove old debug tracing 2022-06-20 00:59:22 -07:00
Josh Slocum 34e6a8f942
Merge pull request #7399 from sfc-gh-jslocum/bg_tenant_improvements
Bg tenant improvements
2022-06-17 11:19:41 -05:00
Josh Slocum 1cc466e068 fixes and review comments 2022-06-17 08:17:44 -05:00
Josh Slocum b3597ef3a8 Added plumbing for tenant-aware purge granules 2022-06-16 13:04:34 -05:00
Markus Pilman 13d8b13722 Migrated Authz code to use JWT 2022-06-13 18:20:27 -06:00
Markus Pilman 799fe32346 Merge remote-tracking branch 'origin/main' into features/authz 2022-06-13 18:02:11 -06:00
Andrew Noyes 207e0bc105
Fix a few places we weren't doing exponential backoff (#7349)
* Fix a few places we weren't doing exponential backoff

We re-create the transaction every iteration of each of these retry
loops, so we need to manage exponential backoff here ourselves.

Closes #7301

* Remove former Backoff definition
2022-06-13 13:18:58 -07:00
sfc-gh-tclinkenbeard df71a49bf6 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-13 10:03:10 -07:00
sfc-gh-tclinkenbeard 75c858eb2c Differentiate between different quotas in GlobalTagThrottling workload 2022-06-13 10:01:55 -07:00
Josh Slocum 710612442c small fixes 2022-06-09 17:21:21 -05:00
Josh Slocum d6920cde28 Implemented blob granule merging 2022-06-09 10:50:53 -05:00
Josh Slocum a3289f9cab adding tenant prefix to bg ranges call 2022-06-06 14:09:10 -05:00
A.J. Beamon 2907aafa60 Merge branch 'main' into feature-metacluster 2022-06-02 12:18:42 -07:00
Ray Jenkins 8cc51064a5
Add NAPI: prefix to VerifyCausalReadRisky span. (#7285) 2022-06-01 11:47:28 -05:00
sfc-gh-tclinkenbeard 29ebcdbfa9 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-05-31 14:53:51 -07:00
Vaidas Gasiunas 4d6ec7663f Close file at the end of runNetwork rather than in stopNetwork in order to avoid a race condition,
also in order to continue tracing the pending network thread activity.
Poll event throttler only in the network thread in order to avoid a race condition.
2022-05-31 13:59:09 +02:00
Lukas Joswiak 4c07064632 Fix reference cycle in GlobalConfig 2022-05-27 10:25:29 -07:00
Renxuan Wang cd2a575e02
Move the resolve of coordinator hostname from getCoordinatorProtocol() to getClusterProtocolImpl(). (#7245)
* Move the resolve of coordinator hostname from getCoordinatorProtocol() to getClusterProtocolImpl().

* Guard DNS Cache behind a knob.
2022-05-26 09:45:54 -07:00
Josh Slocum 458e8018e1 review comments 2022-05-25 17:16:56 -05:00
Josh Slocum fd7b662767 cleaning up 2022-05-25 17:16:56 -05:00
Josh Slocum dd637dd6a7 passes tenant simulation test 2022-05-25 17:16:56 -05:00
Josh Slocum e3a570d50d Blob worker tenant integration mostly works 2022-05-25 17:16:56 -05:00
Josh Slocum 4015b5b2a0
Several Blob Granule bug fixes found in nightlies (#7170)
* Fixing simulation validation assert that was tripping incorrectly

* Commenting out debugging prints

* Fixed multiple error propagation issues in blob worker
2022-05-23 10:07:16 -07:00
Markus Pilman 16cf087667 Allow fetching invalid tenant id for getKeyLocation 2022-05-23 10:00:27 -06:00
A.J. Beamon d784173f7f Add first implementation of tenant creation and deletion in a metacluster 2022-05-20 15:21:21 -07:00
Chaoguang Lin 5e8c3130e6 Extend the reboot interface to accept comma-delimited string;
Only fetch requested worker interfaces in rebootWorkerActor
Add killall test to multiprocess_fdbcli_tests
Make the rebootWorker only sends requests if all the requested workers are valid
Add comments; Organize print texts; Fix the bug clear the map every time run kill/suspend/expensive_data_check
2022-05-20 12:06:33 -07:00