Commit Graph

743 Commits

Author SHA1 Message Date
Steve Atherton fdc8e2118e Changed Redwood shutdown order so that users get the error signal first and have a chance to cancel pending operations before they are canceled by force which causes broken_promise errors. 2022-10-23 01:52:25 -07:00
Steve Atherton 970eb4a043 Add option in ObjectCache clear for whether or not to wait for safe eviction for each item. 2022-10-23 01:50:18 -07:00
Steve Atherton cd83595a0f Merge remote-tracking branch 'sfc-gh-tclinkenbeard/clear-key-provider' into redwood-page-lifetimes 2022-10-22 17:55:09 -07:00
Steve Atherton fa0ea1368d Now that IO operation cancellation is safe, explictly cancel all pending operations during shutdown in the operations vector or in the caches. 2022-10-22 17:55:02 -07:00
Steve Atherton 94f3eee3a8 Update comment for recent changes. 2022-10-22 16:12:57 -07:00
Steve Atherton 46dd71b008 Change extent reads to use readPhysicalBlock to avoid output buffer lifetime issues while allowing the extent read actor to be cancelled. 2022-10-22 02:55:45 -07:00
Steve Atherton 76316339ac Merge commit '7dacaed98368ec0790c9e18a63dfa0035a31fcff' into redwood-page-lifetimes 2022-10-22 02:30:43 -07:00
Steve Atherton d7f9de53f5 Reworked Redwood's file read/write buffer lifetime safety to be more simple and lower overhead. The lowest level file read/write ops are uncancellable and hold references to their in/out buffers, so now read/write futures in the operations vector or the page cache can be cancelled which allows shutdown to directly cancel active operations. 2022-10-22 02:30:15 -07:00
neethuhaneesha a1eb1d4a48
Rocksdb storage using single_key_deletes instead of deleterange on clearrange operation. (#8452) 2022-10-21 15:47:19 -07:00
sfc-gh-tclinkenbeard e168950a93 Clear DecodeBoundaryVerifier::keyProvider in ~VersionedBTree 2022-10-21 11:26:55 -07:00
Steve Atherton 0332aa0320 Add comments explaining details for page memory and read/write future lifetimes. 2022-10-21 01:16:29 -07:00
Steve Atherton b361c848f2 Bug fix in page memory lifetimes: Page read futures that are not stored in the page cache must be wrapped in uncancellable(). 2022-10-21 00:14:33 -07:00
Steve Atherton f2dbbcce40 Allow overlapping commits in Redwood in which the caller drops the commit futures. Call IKVS::init() in TLogServer. 2022-10-06 12:48:06 -07:00
Yi Wu 5c549601d2
Split Redwood page by tenant boundary (#7979)
Redwood encrypt with page granularity. To do per-tenant encryption (i.e. each tenant are encrypted with different set of cipher keys), we need to split Redwood pages by tenant boundary. Moreover, it also needs to handle different tenant modes:
* tenantMode = disabled: do not split page by tenant, all data encrypt using default encryption domain.
* tenantMode = required: look at the prefix of the keys and split by tenant accordingly, and encrypt in tenant specific encryption domain accordingly.
* tenantMode = optional: some key ranges may not map to a tenant. In additional to looking at the key prefix, the key provider also query the tenant prefix index. For prefixes not found in the tenant prefix index, corresponding key should be encrypted using the default encryption domain.

The change also enforce data for each tenant forms a subtree, and key of the link to the subtree is exactly the tenant prefix.

This PR is building on top of #8172 and use the IPageEncryptionKeyProvider interface added there. Changes:
* In `writePages` and `splitPages`, query the key provider to split page accordingly.
* In `commitSubtree`, when doing in-place update (to both of leaf or internal page), check if the entry being insert belong to the same encryption domain as existing data of the page. If not, fallback to full page rebuild, where `writePages` will handle the page split.
* When updating the root, check if it is encrypted using non-default (i.e. tenant specific) domain. If so, add a redundant root node which will be encrypted with default encryption domain.

Tested with 100K run of `Lredwood/correctness/btree` unit test, where it uses `RandomEncryptionKeyProvider`, which is updated to support and generate random encryption domain with 4 byte domain prefixes.
2022-10-04 12:53:55 -07:00
A.J. Beamon e1fe28b78b Switch some usages of LiteralStringRef to use the _sr suffix 2022-09-30 16:04:16 -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
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
Steve Atherton ab41da174c Completely rewrote PriorityMultiLock scheduling and added a unit test for it. 2022-09-20 00:45:29 -07:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
Steve Atherton 74b152e550 Removed two obsolete things: explicit maxPriority argument from PriorityMultiLock as it is redundant after the launch limit refactor, and the redwood read concurrency lock which is no longer needed after the StorageServer priority refactor as it will control the concurrency of requests sent to the KVS. 2022-09-18 18:23:15 -07:00
Steve Atherton 6b0eeb8efc Move PriorityMultiLock to its own header file so that changing it does not require recompiling everything. 2022-09-18 17:17:56 -07:00
Steve Atherton c0c9ac3bf5 Simplification, only runnerCounts workers (formerly workerCounts) and available counts in addRunner(). Renamed all uses of "worker" to "runner" for more clarity. 2022-09-18 01:13:27 -07:00
Yi Wu e66942ada4
Update Redwood encryption interface (#8172)
Update Redwood encryption interface to make it better suit for per-tenant encryption, where we will need to do tenant page split.
2022-09-16 15:56:05 -07:00
Fuheng Zhao ac65c3f569 merge upstream main 2022-09-15 14:19:19 -07:00
sfc-gh-tclinkenbeard 82adc1e856 Make g_simulator a pointer 2022-09-15 09:00:33 -07:00
Steve Atherton 3063061c09 Move sample benchmarks to Flowbench. 2022-09-12 01:31:09 -07:00
Steve Atherton 37feb11e41 Refactored some unit tests on sampler performance and added new types. 2022-09-09 18:35:52 -07:00
Fuheng Zhao 61233123b2 format 2022-09-01 11:26:32 -07:00
Fuheng Zhao 0aa096dc17 sync with upstream main 2022-08-31 15:46:39 -07:00
Yi Wu 49503987cc
Support Redwood encryption (#7376)
A new knob `ENABLE_STORAGE_SERVER_ENCRYPTION` is added, which despite its name, currently only Redwood supports it. The knob is mean to be only used in tests to test encryption in individual components, and otherwise enabling encryption should be done through the general `ENABLE_ENCRYPTION` knob.

Under the hood, a new `Encryption` encoding type is added to `IPager`, which use AES-256 to encrypt a page. With this encoding, `BlobCipherEncryptHeader` is inserted into page header for encryption metadata. Moreover, since we compute and store an SHA-256 auth token with the encryption header, we rely on it to checksum the data (and the encryption header), and skip the standard xxhash checksum.

`EncryptionKeyProvider` implements the `IEncryptionKeyProvider` interface to provide encryption keys, which utilizes the existing `getLatestEncryptCipherKey` and `getEncryptCipherKey` actors to fetch encryption keys from either local cache or EKP server. If multi-tenancy is used, for writing a new page, `EncryptionKeyProvider` checks if a page contain only data for a single tenant, if so, fetches tenant specific encryption key; otherwise system encryption key is used. The tenant check is done by extracting tenant id from page bound key prefixes. `EncryptionKeyProvider` also holds a reference of the `tenantPrefixIndex` map maintained by storage server, which is used to check if a tenant do exists, and getting the tenant name in order to get the encryption key.
2022-08-31 12:19:55 -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
Fuheng Zhao 620c119e9a update storage server priorities 2022-08-30 12:07:45 -07:00
Fuheng Zhao 7c6dbaf3cf update trState ReadOption to optional 2022-08-24 15:04:17 -07:00
Fuheng Zhao 4e748d6bed use optional ReadOptions and RangeReadOptions in requests 2022-08-23 17:16:47 -07:00
Fuheng Zhao 78f4b4f739 add RangReadOptions which inherit from ReadOptions 2022-08-22 11:46:01 -07:00
Fuheng Zhao e69e93496b inherit readOptions passed from FetchKeys 2022-08-17 14:05:32 -07:00
Fuheng Zhao 70ae255744 add Redwood PML metrics 2022-08-15 11:34:09 -07:00
Steve Atherton a5bb723550 Remove effective root pointer size limit by building additional root levels until the pointer is small enough to fit in the commit record. 2022-08-15 00:10:55 -07:00
Fuheng Zhao d24a52952c update readOption struct 2022-08-10 10:16:26 -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
A.J. Beamon 7457b42b0a Fix undefined behavior in versioned btree test due to integer overflow 2022-08-07 05:50:22 -07:00
Fuheng Zhao d5c3679046 merge upstream main and resolve conflicts 2022-08-04 12:15:00 -07:00
Junhyun Shim e2a3fedfc7
Merge branch 'main' into features/authz 2022-07-27 00:08:57 +02:00
Junhyun Shim 0874e553cd Place generateRandomData() under {I|Deterministic}Random 2022-07-20 13:21:11 +02: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
Fuheng Zhao 312e160a12 use PriorityMultiLock in storage server 2022-07-14 15:29:54 -07:00
Fuheng Zhao d77695b77f use explicit number for ioMaxPriority 2022-07-12 11:54:10 -07:00
Fuheng Zhao 39b37a80ef remove comments and format 2022-07-11 16:10:38 -07:00
Fuheng Zhao 358b592458 Merge branch 'main' of https://github.com/apple/foundationdb into RedwoodIOLaunchLimit 2022-07-11 15:19:35 -07:00