Commit Graph

1857 Commits

Author SHA1 Message Date
Xiaoge Su 7a0829a14e fixup! Remove comments 2022-11-30 14:31:09 -08:00
Xiaoge Su 98d3357c59 fixup! Reformat source 2022-11-30 14:31:09 -08:00
Xiaoge Su a0fc3685c9 fixup! Update code per comments 2022-11-30 14:31:09 -08:00
Xiaoge Su a355289d63 Remove cx->clearWatchMetadata() when connection file changed
In NativeAPI.actor.cpp, ::watch ACTOR will call cx->clearWatchMetadata()
when the connectionFileChanged event is triggered. After that, it will
create a new watch metadata for itself.

If there are multiple watches, each of them that receives the
cnnectionFileChanged will clear *all* watch data and create *one* watch
for itself. This does not makes sense. A watch should only clear the
metadata, and then create one, for itself.

cx->clearWatchMetadata() is only used there, thus removed.
2022-11-30 14:31:09 -08:00
Xiaoge Su b35d1b614e Revert "Merge pull request #8602 from apple/revert-8498-mmmm"
This reverts commit 4d789b2fd9, reversing
changes made to 9625efd5b9.
2022-11-30 14:31:09 -08:00
He Liu 3d2124df80
Checkpoint restore sharded rocks (#8758)
* Allow multiple keyranges in CheckpointRequest.
Include DataMove ID in CheckpointMetaData.

* Use UID dataMoveId instead of Optional<UID>.

* Implemented ShardedRocks::checkpoint().

* Implementing createCheckpoint().

* Attempted to change getCheckpointMetaData*() for a single keyrange.

* Added getCheckpointMetaDataForRange.

* Minor fixes for NativeAPI.actor.cpp.

* Replace UID CheckpointMetaData::ssId with std::vector<UID>
CheckpointMetaData::src;

* Implemented getCheckpointMetaData() and completed checkpoint creation
and fetch in test.

* Refactoring CheckpointRequest and CheckpointMetaData

rename `dataMoveId` as `actionId` and make it Optional.

* Fixed ctor of CheckpointMetaData.

* Implemented ShardedRocksDB::restore().

* Tested checkpoint restore, and added range check for restore, so that
the target ranges can be a subset of the checkpoint ranges.

* Added test to partially restore a checkpoint.

* Refactor: added checkpointRestore().

* Sort ranges for comparison.

* Cleanups.

* Check restore ranges are empty; Add ranges in main thread.

* Resolved comments.

* Fixed GetCheckpointMetaData range check issue.

* Fixed error description.

Co-authored-by: He Liu <heliu@apple.com>
2022-11-30 08:22:14 -08:00
Dennis Zhou f10247aa25
blob: purge range fix (#8867)
* blob: adjacent purge unit test

Ensure [A, B), [B, C) can be purged independently.

* blob: fix purge alignment condition

We only need to check if the first range starts before the end.
Additionally, an empty range is problematic if passed to getRange() and
we're expecting additional values past the end of the range.
2022-11-21 12:26:19 -06:00
sfc-gh-tclinkenbeard 453f3f44c6 Merge remote-tracking branch 'origin/main' into expose-tag-throttled-duration 2022-11-21 09:17:48 -08:00
Lukas Joswiak 750669c9d8 Remove unnecessary buggify 2022-11-21 09:03:22 -08:00
Lukas Joswiak 7d73d52a91 Enable tracing in simulation
This will help test the flow of span IDs from the client all the way to
the storage servers.
2022-11-21 09:03:22 -08:00
sfc-gh-tclinkenbeard 3c97f43138 Change Histogram::Unit::microseconds to milliseconds 2022-11-21 08:03:56 -08:00
Hui Liu de8285f11d
Merge pull request #8834 from sfc-gh-huliu/status
Show blob restore in fdbcli status command
2022-11-18 16:03:30 -08:00
Hui Liu 2e62822183 Show blob restore in fdbcli status command 2022-11-17 14:22:59 -08:00
Steve Atherton 8e8c4b4489
Merge pull request #8170 from sfc-gh-sgwydir/ddsketch
Use DDSketch for sample data
2022-11-17 10:38:12 -08:00
Ankita Kejriwal 3036f2458f
Merge pull request #8803 from sfc-gh-akejriwal/commitproxies
Add a transaction option to bypass storage quota enforcement
2022-11-15 15:22:11 -08:00
sfc-gh-tclinkenbeard 82db9415fb Add const qualifier to more methods
This commit mainly targets get* and is* methods
2022-11-15 14:57:32 -08:00
sfc-gh-tclinkenbeard ec615181ce Mark several more methods const 2022-11-15 14:57:32 -08:00
sfc-gh-tclinkenbeard c03f60c618 Update rare code probe annotations 2022-11-15 13:21:25 -08:00
Ankita Kejriwal 05c914d85f Incorporate code review suggestions 2022-11-14 13:06:27 -08:00
Kevin Hoxha 47a8cebfb3 ddsketch: Make sure that all ctors use 0 < error < 1 2022-11-14 11:41:06 -08:00
sfc-gh-tclinkenbeard 2bbf823b24 Implement Transaction::getTagThrottledDuration 2022-11-13 14:39:22 -08:00
sfc-gh-tclinkenbeard 7fc85d86b4 Add fdb_transaction_get_tag_throttled_duration function to C bindings 2022-11-13 11:22:57 -08:00
Sam Gwydir 7f33b0fa70 clang-format 2022-11-12 14:09:31 -08:00
Sam Gwydir 7ea42841a4 Merge remote-tracking branch 'origin/main' into ddsketch 2022-11-12 13:52:57 -08:00
Sam Gwydir 23706c957b Use DDSketch for Sample Data. 2022-11-12 13:45:46 -08:00
Ankita Kejriwal dcbe51f24e Merge branch 'main' of github.com:apple/foundationdb into commitproxies 2022-11-11 17:28:01 -08:00
Ankita Kejriwal 2e4cd67fb8 Add a transaction option to bypass storage quota enforcement.
This can be used for transactions that only delete data to allow them to
commit even if the tenant group is over its storage quota.
2022-11-11 16:54:35 -08:00
Hao Fu 7e78795284
add bytelimit for prefetch (#8768)
* add bytelimit for prefetch

A fraction of byteLimit will be used as the limit to fetch index.
For the indexes fetched, fetch records for them in batch.

byteLimit always count the index size, it also count record if exist,
it at least return 1 index-record entry and always include the last entry
despite that adding the last entry despite it might exceed limit.

There is a Knob STRICTLY_ENFORCE_BYTE_LIMIT, when it is set, records
will be discarded once the byteLimit is hit, despite they are fetched.
Otherwise, return the whole batch.
2022-11-11 13:36:06 -08:00
Hui Liu 5834517570 Add fdbcli blobrestore to start the full restore 2022-11-11 08:32:23 -08:00
Ankita Kejriwal 76733ddde6 Merge branch 'main' of github.com:apple/foundationdb into commitproxies 2022-11-09 19:09:06 -08:00
Ankita Kejriwal 8b489be340 Handle future_version() in tenantaware storage metrics function 2022-11-09 17:50:04 -08:00
Ankita Kejriwal 105648b888 Merge branch 'main' of github.com:apple/foundationdb into commitproxies 2022-11-09 17:38:30 -08:00
sfc-gh-tclinkenbeard ca572f58fb Combine *_COST_BYTE_FACTOR knobs into a single TAG_THROTTLING_PAGE_SIZE knob 2022-11-08 07:44:01 -08:00
Ankita Kejriwal 7dde2a755b Reject transactions if the tenant is over quota 2022-11-07 15:59:26 -08:00
Jingyu Zhou 0adcd92d33
Merge pull request #8461 from hfu94/id
Each getRange request in a txn has a distinct trace id
2022-11-07 09:34:22 -08:00
A.J. Beamon 93142e2c29 In try commit, wait for the read version future before waiting for the commit cost estimate. This allows us to give precedence to the database_locked error over errors thrown by the commit cost estimation. 2022-11-02 14:47:24 -07:00
Ankita Kejriwal ffbd81cfcf Merge branch 'main' of github.com:apple/foundationdb into monitorusage 2022-11-01 16:51:27 -07:00
Trevor Clinkenbeard 39abc712b0
Merge pull request #8549 from sfc-gh-tclinkenbeard/expose-txn-cost
Create `fdb_transaction_get_total_cost` function
2022-11-01 08:14:57 -07:00
Ankita Kejriwal 6fa5059521 Tweak where TenantInfo is initialized in metrics functions in NativeAPI
Also clean up debug trace events
2022-10-31 16:48:06 -07:00
Dennis Zhou f7b608e53f blob: refactor blob get tenant code 2022-10-31 10:37:36 -07:00
Dennis Zhou 1ab432e49d blob: fix error propagation in getBlobRanges()
Fixes: 48d6e725c2 ("blob: convert listBlobbifiedRangesActor() to take a Transaction")
2022-10-31 10:37:36 -07:00
sfc-gh-tclinkenbeard 0eb1598afa Merge remote-tracking branch 'origin/main' into expose-txn-cost 2022-10-30 09:36:37 -07:00
Ankita Kejriwal 82ab299788 Merge branch 'main' of github.com:apple/foundationdb into monitorusage 2022-10-28 15:42:27 -07:00
Steve Atherton 326d45819e Merge branch 'main' into storageserver-pml 2022-10-28 14:14:44 -07:00
Ankita Kejriwal ba382169d1 Handle `unknown_tenant` error in metrics functions in NativeAPI 2022-10-28 13:37:40 -07:00
Andrew Noyes 0a15f081a1
Proactively clean up idempotency ids for successful commits (#8578)
* Proactively clean up idempotency ids for successful commits

This change also includes some minor changes from my branch working on
an idempotency ids cleaner, that I'd like to get merged sooner rather
than later.

- Adding a timestamp to idempotency values
- Making IdempotencyId an actor file
- Adding commit_unknown_result_fatal
- Checking idempotencyIdsExpiredVersion in determineCommitStatus
- Some testing QOL changes

* Factor out decodeIdempotencyKey logic

* Fix formatting

* Update flow/include/flow/error_definitions.h

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>

* Use KeyBackedObjectProperty for idempotencyIdsExpiredVersion

* Add IDEMPOTENCY_ID_IN_MEMORY_LIFETIME knob

* Rename ExpireIdempotencyKeyValuePairRequest

Also add a code probe for the case where an ExpireIdempotencyIdRequest is
received before the count is known, and add an assert

* Fix formatting and add TODO for nwijetunga

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2022-10-28 09:07:54 -07:00
Steve Atherton d53ed6acae Merge branch 'main' into storageserver-pml 2022-10-28 00:14:01 -07:00
Jingyu Zhou dc60f63f9b Revert "Cancel watch when the key is not being waited"
This reverts commit 639afbe62c.
2022-10-27 19:46:05 -07:00
Jingyu Zhou 634bd529e7 Revert "Record the version of each watch"
This reverts commit 4bd24e4d64.
2022-10-27 19:46:05 -07:00
Jingyu Zhou e460933b52 Revert "Remove debugging output"
This reverts commit 41d1d6404d.
2022-10-27 19:46:05 -07:00
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