Commit Graph

1930 Commits

Author SHA1 Message Date
A.J. Beamon 469e77158f Add metacluster support for tenant locking 2023-02-27 16:53:13 -08:00
Josh Slocum 716a9c3817 addressing review comments and fixmes in bg commit proxy code 2023-02-27 10:51:47 -06:00
Vaidas Gasiunas ba726fac87 Replace hardcoded API version checks for 720 and 730 2023-02-27 16:18:01 +01:00
Josh Slocum 6187811f71
Reworking getBlobGranuleRanges to also use commit proxy rpc for authz, and adding test (#9470) 2023-02-24 17:15:32 -06:00
Markus Pilman 8695fc15fc Merge remote-tracking branch 'origin/main' into features/tenant-lock2 2023-02-22 13:12:23 -07:00
Steve Atherton 23df46773d
Merge pull request #9422 from sfc-gh-satherton/client-read-options
Add transaction option definitions for read priority and read cache
2023-02-22 09:00:25 -08:00
Josh Slocum bf97c3dbce
adding java tenant blob management test and fixing bug it found (#9428) 2023-02-22 10:52:26 -06:00
Steve Atherton a21b2fe9f9 Simplified read priority option to three separate options for normal/low/high priority. 2023-02-21 22:48:38 -08:00
Steve Atherton 5969616af8 Merge commit '6de85e7cd8e9dd74a571de9e04679e669bcbb5b6' into client-read-options 2023-02-21 20:46:20 -08:00
Markus Pilman 15d8548c0e Merge remote-tracking branch 'origin/main' into features/tenant-lock2
# Conflicts:
#	fdbserver/ApplyMetadataMutation.cpp
#	fdbserver/storageserver.actor.cpp
2023-02-21 13:39:35 -07:00
Josh Slocum 958f3b531b
Plumbing blob worker mapping through commit proxy like storage server (#9401)
* Plumbing blob worker mapping through commit proxy like storage server mapping

* review comments

* formatting
2023-02-21 13:21:44 -06:00
Steve Atherton 246fd1dd4e Remove auto cache option since there is no meaningful implementation of this yet. Change places using trState in a native Transaction to set cache mode or Low/Normal/High priority to use the new transaction options instead. 2023-02-21 02:50:30 -08:00
Steve Atherton 9bf28899d4 Add transaction option definitions for read priority and read server side cache mode. 2023-02-21 00:54:35 -08:00
sfc-gh-tclinkenbeard 398079db3a Merge remote-tracking branch 'origin/main' into expose-tag-throttled-duration 2023-02-20 17:54:06 -08:00
Josh Slocum bfb3ffc509
added c and java apis for granule flush (#9412) 2023-02-20 10:28:11 -06:00
sfc-gh-tclinkenbeard 1aef6cb5f7 Merge remote-tracking branch 'origin/main' into expose-tag-throttled-duration 2023-02-17 20:41:59 -08:00
Josh Slocum 6c2fb13173
adding wait parameter to blobbify api (#9360)
* adding wait parameter to blobbify api

* formatting

* fixing comment style

* fixing bug and adding debugging

* adding blob ranges unit test

* testing both blobbify cases in cancel

* formatting

* switch to explicit blocking api instead of boolean flag

* remove comments

* format
2023-02-17 12:20:53 -06:00
Junhyun Shim d9c126a2d9
Introduce WipedString for Arena block holding AuthZ tokens (#9381)
* Enable secure allocation mode in Arena

This mode allows zeroing out blocks holding sensitive data after use

* Introduce WipedString to all token-holding memory

Also introduce a option flag "sensitive"

* Make pointer equivalency a hard requirement for non-ASAN builds

So that we can detect when Arena/malloc/memory-wipe behavior changes
2023-02-16 10:44:32 +01:00
Markus Pilman 3017e15448 Merge remote-tracking branch 'origin/main' into features/tenant-lock2
# Conflicts:
#	fdbclient/include/fdbclient/TenantManagement.actor.h
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
2023-02-13 11:43:07 +01:00
Josh Slocum 1e5bac6238
fixing fault injection stalling change feed fetch (#9316) 2023-02-08 15:49:56 -06:00
Ankita Kejriwal b9630e57d9
Merge pull request #9291 from sfc-gh-akejriwal/debug2
Update storage metrics functions to use the version at which the tenant was read
2023-02-08 11:33:33 -08:00
sfc-gh-tclinkenbeard 09ad864eb5 Merge remote-tracking branch 'origin/main' into expose-tag-throttled-duration 2023-02-08 11:25:14 -08:00
Junhyun Shim d32d3dd085 Make token option NOT survive transaction hard resets 2023-02-08 18:12:22 +01:00
Junhyun Shim be225acd2a Merge remote-tracking branch 'origin/main' into authz-tenant-name-to-tenant-id 2023-02-06 23:13:43 +01:00
Junhyun Shim 6993e391f2 Extend authz test to include with/without GRV caching and forced MVC 2023-02-06 13:18:10 +01:00
Markus Pilman 1fb3c33b3f Merge remote-tracking branch 'origin/main' into features/tenant-lock2
# Conflicts:
#	fdbserver/CommitProxyServer.actor.cpp
2023-02-06 11:58:49 +01:00
Ankita Kejriwal 1a240a0eab Merge branch 'main' of github.com:apple/foundationdb into debug2 2023-02-03 12:26:19 -08:00
Ankita Kejriwal 913bc9114d Handle errors that can't be sent in reply; fix formatting 2023-02-02 19:05:05 -08:00
Hui Liu 774446d3a0 Support pagination for StorageServer splitMetrics API 2023-02-02 14:21:38 -08:00
Vaidas Gasiunas f8b1da8bc6
An option to initialize client tracing in setupNetwork (#9209)
* client_config_tester: use a generic mechanism to set specific network options

* trace_initialize_on_setup option to initialize client traces on network setup without local IP address

* trace_initialize_on_setup: Addressing review comments

* Restore correct formatting

* trace_initialize_on_setup: Update go bindings

* Include PID for identification into trace file names by default

* Use the same naming pattern for trace files in all configurations

* Empty commit
2023-02-02 10:00:51 +01:00
Ankita Kejriwal 9529f360ee Update storage metrics functions to use the version at which tenant was read 2023-02-01 19:44:31 -08:00
A.J. Beamon b8592c4e09
Merge pull request #9219 from sfc-gh-jfu/tenant-object-binding-tests
Add tenant getId to java/python binding tester
2023-01-31 16:22:38 -08:00
Hui Liu 6fbabab6aa Fix misc blob restore error messages 2023-01-30 13:01:27 -08:00
Markus Pilman 64c11c1f34 Implemented tenant lock and basic test 2023-01-26 15:47:39 +01:00
Jon Fu 6493da877a add method to return idfuture 2023-01-25 12:45:35 -08:00
Sreenath Bodagala fe4a839600
- Do not add fdbserver processes to the client list. (#9225)
Note: Server processes started getting reported as clients since 7.1.0
(not sure if this change in behavior was intentional or not), and this
breaks the operator upgrade logic.
2023-01-25 14:39:32 -05:00
Jingyu Zhou 27e1b76b68
Merge pull request #9226 from xis19/main-bench
Extract boost/asio.hpp out from flow/network.h
2023-01-25 09:14:52 -08:00
Xiaoge Su e2cc90c18f Extract GetServerDBInfoRequest, ClientDBInfo and OpenDatabaseRequest
Wall time: 909.3
clang time: 12747.718300
2023-01-24 14:40:11 -08:00
Evan Tschannen a1bf0829a2
Encrypt change feeds (#9164)
* encrypted change feeds, still missing re-encryption of mutations which have been modified

* removed inverted filtering and reduced the number of comparisons for calculating clear intersection

* fix merge conflict

* fixed another merge conflict

* encrypt mutations which have been modified

* renamed encrypted to encryptedMutation

* fix formatting

* format nativeAPI

* format code

* more formatting fixes
2023-01-24 14:20:54 -08:00
A.J. Beamon adb8d3ec7a Fix a memory issue when getting key range locations that manifests in particular when getting range split points 2023-01-23 11:01:37 -08:00
A.J. Beamon b10d1f227b Remove tenant name from the TenantInfo object 2023-01-20 14:04:43 -08:00
A.J. Beamon d47a2ab60f
Merge pull request #9128 from sfc-gh-ajbeamon/transactions-use-tenant-object
Transactions take a tenant object rather than a tenant name
2023-01-20 12:06:36 -08:00
He Liu ec6716ff2e
Restore kv (#9030)
* 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.

* Refactor CheckpointReader for CF checkpoint.

* Added CheckpointAsKeyValues as a parameter for newCheckpointReader.

* PhysicalShard::restoreKvs().

* Added `ranges` in fetchCheckpoint.

* Added RocksDBCheckpointKeyValues::ranges.

* Added ICheckpointIterator and implemented for RocksDBCheckpointReader.

* Refactored OpenAction for CheckpointReader, handled failure cases.

* Use RocksDBCheckpointIterator::end() in readRange.

* Set CheckpointReader timout and other Rocks read options.

* Implementing fetchCheckpointRange().

* Added more CheckpointReader tests.

* Cleanup.

* More cleanup.

* Added fetchCheckpointRanges test.

* Implemented restore of kv-based checkpoint.

* Improved CheckpointRestore test for kv, non-kv, as well as partial
restore.

* Added test of merge.

* Fixed merge test.

* Cleanup.

* Resolved comments.

Co-authored-by: He Liu <heliu@apple.com>
2023-01-20 09:58:34 -08:00
A.J. Beamon 258198ca20 Merge branch 'main' into transactions-use-tenant-object
# Conflicts:
#	fdbclient/include/fdbclient/DatabaseContext.h
#	fdbserver/workloads/BulkLoadWithTenants.actor.cpp
2023-01-20 09:06:39 -08:00
Hui Liu 36e8e5a3bb
Merge pull request #9176 from sfc-gh-huliu/restoreversion
Restore to a previous version
2023-01-19 17:37:23 -08:00
Hui Liu c85b984c3a blobrestore to previous point of time 2023-01-19 14:45:01 -08:00
Nim Wijetunga 82c92abca2
Change Noisy Sev30s to Sev20s (#9180)
change noisy sev30 traces to sev20
2023-01-19 14:06:34 -08:00
A.J. Beamon e1d48d28bf Remove tenant name from the TenantInfo object 2023-01-13 08:58:15 -08:00
Josh Slocum 0fc5c6c1e2
tenant entry was removed, changed to fixme (#9132) 2023-01-12 18:39:22 -06:00
Josh Slocum b6450f9eaa
More ss cf perf fixes main (#9109)
* changing future version logic for change feed fetch

* Optimizing change feed data structures and accesses

* coalescing change feed request ranges for merge cursor if they're to the same team

* fixing over-read of memory mutations for change feeds

* feed filter mutations common prefix cpu optimiation

* fix formatting
2023-01-12 16:15:05 -06:00
Xiaoxi Wang 07b37245dd merge upstream/main; solve merge conflicts 2023-01-12 12:29:03 -08:00
A.J. Beamon f999623bb1 Add a tenant lookup interface and use it when starting transactions 2023-01-06 15:51:12 -08:00
sfc-gh-tclinkenbeard 0f14647bbf Merge remote-tracking branch 'origin/main' into expose-tag-throttled-duration 2023-01-05 08:10:49 -08:00
Xiaoxi Wang e3d09a5cbd Merge branch 'main' of https://github.com/apple/foundationdb into feature/main/tenantCheck 2023-01-04 16:16:15 -08:00
Xiaoxi Wang 8266f52dea
Merge pull request #9012 from sfc-gh-xwang/feature/main/wiggleDelay
Persist accumulated wiggle delay
2023-01-04 16:14:09 -08:00
Hui Liu e3bf79cf71 Add correctness test for blob restore 2023-01-04 11:10:34 -08:00
Xiaoxi Wang bbcb3cc018 extract KeyBackedConfig, StorageWiggleData class; solve template resolution problem; solve MV txn and native api conflict by splitting RunTransaction file 2023-01-02 23:34:39 -08:00
Xiaoxi Wang 8ff6d6c7ee merge upstream/main; solve conflicts 2022-12-17 15:57:07 -08:00
Xiaoxi Wang 61e3917d58 check tenant access in applyMetadataToCommittedTransactions 2022-12-14 13:27:50 -08:00
Xiaoxi Wang c12de23824 Merge branch 'main' of https://github.com/apple/foundationdb into feature/main/wiggleDelay 2022-12-11 14:27:22 -08:00
Jingyu Zhou fee561921a Fix assertion failure from changeFeedTSSValidator() 2022-12-10 10:02:14 -08:00
sfc-gh-tclinkenbeard 68f14f017c Fix clang 15 compiler warnings 2022-12-08 13:59:37 -08:00
Xiaoxi Wang ccc494319c perpetual wiggle key functions 2022-12-08 16:46:05 -05:00
Kevin Hoxha 3cea754ba3 metrics: Add OTEL metric definitions 2022-12-08 10:07:11 -08:00
Kevin Hoxha 188e635b2e metrics: Avoid name conflicts in MetricCollection
- In Counter constructor, make sure that we combine CounterCollection name
- In IMetric constructor, add a trace event and assertion in case of collision
- Rename ClusterRecoveryData CounterCollection name from master to ClusterRecoveryData
2022-12-08 10:07:11 -08:00
FoundationDB CI 86d6106dc1
format source code after switch to clang 15 2022-12-08 17:26:45 +00:00
Hao Fu d11b5b44e0
Remove boundaryAndExist (#8994)
* Remove boundaryAndExist

Client knows whether an entry is a boundary, and client also can
see whether the record for that entry exist by checking whether
the rangeResult is empty. This field is useless.

This field breaks backward compatibility, need to remove it.
2022-12-07 18:08:15 -08:00
Marian Dvorsky 085fce8478
Distributed tracing related improvements (#8942)
Several fixes/improvements related to distributed traces.

Remove "key" attributes and the TRACING_SPAN_ATTRIBUTES_ENABLED knob: we almost never want to log actual keys (as they can contain private data), however, we do want to use other span attributes.
In Transaction::setTransactionID, properly propagate spanContext flags, and set all copies of spancontext
2022-12-07 17:58:52 +01:00
A.J. Beamon b1fb8e8c7b Resolve merge issue by renaming namespace (combining with existing TenantAPI namespace) 2022-12-05 15:47:58 -08:00
A.J. Beamon ce4a2a55b2 Remove the usage of tenant names (mostly) from the storage server 2022-12-05 15:44:41 -08:00
Trevor Clinkenbeard 6f70fc243b
Add rare code probe annotations (#8948) 2022-12-05 09:23:47 -08:00
sfc-gh-tclinkenbeard 4b6098931c Merge remote-tracking branch 'origin/main' into expose-tag-throttled-duration 2022-12-04 08:40:04 -08:00
sfc-gh-tclinkenbeard 994fd4aa41 Remove rare annotation from some code probes 2022-12-01 09:59:08 -08:00
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