Commit Graph

784 Commits

Author SHA1 Message Date
Josh Slocum 4a0ceca75e swallowing errors in redwood dispose 2023-03-10 17:49:56 -06:00
Steve Atherton 08afc90081 Partially initialized Redwood files will no longer be seen and reopened on disk via the "atomic write and create" file option and delaying the first sync on a new file until it would be recoverable the first commit() initiated by the user. 2023-03-05 12:15:47 -08:00
Steve Atherton b0d595c7d7 Merge commit '3d9f37d1d12f95d52ef2f6bf57f123fdf6101602' into redwood-queue-error-handling 2023-03-03 01:09:04 -08:00
Steve Atherton 8b6efcca82 Added error forwarding to background actors in Redwood to surface errors sooner. This doesn't fix any known failures but it would avoid some broken_promise errors being seen before IO errors, which isn't incorrect just unclear. 2023-03-02 21:54:56 -08:00
Steve Atherton b2d3b35774 Add option to FlowMutex to wait forever if there is an error and use this in Redwood's pager queue cursor. This avoids a broken_promise error being seen before shutdown after a queue read sees an IO error or timeout. 2023-03-02 16:41:45 -08:00
Steve Atherton cad7596e2d Apply clang-format. 2023-02-27 01:07:35 -08:00
Steve Atherton 92bfa1d578 Throw an error if reopened Redwood file is recovered but to a point prior to when the BTree was created if the Encryption Mode of the cluster is not known. 2023-02-26 21:15:48 -08:00
Steve Atherton 29444252fc Prevent Redwood Pager from recovering to a point before the user commit record (ie the BTree CommitRecord) was initialized as this isn't a useful recovery point. 2023-02-26 01:38:24 -08:00
Steve Atherton bb4fb3d81d
Merge pull request #9419 from sfc-gh-satherton/page-rebuild-fix
Optimize/fix node rebuild vs update trigger in Redwood
2023-02-21 13:49:14 -08:00
Steve Atherton e169e65021 Fix to BTree node rebuild logic - rebuild when imbalance hits a limit controlled by a new knob. 2023-02-19 16:40:28 -08:00
Yi Wu 653a5eee28
EaR: Configurable encryption support for Redwood (#9359)
Supporting configurable encryption for Redwood, which supports switching to different encryption algorithm and having variable size encryption header.

Currently to support both old (non-configurable) and new (configurable) encryption header, the PR assume we have a fixed size encryption header (104 bytes) which is large enough to fit both kind of encryption header. Moving forward the plan is to update the IPager interface to support variable size encoding header, and when Redwood tries to in-place update a page but the reserved encoding header buffer is not large enough, rebuild the page instead.
2023-02-17 10:58:48 -08:00
Steve Atherton aba2188491
Merge pull request #9399 from sfc-gh-satherton/read-after-shutdown-protection
Shut down PriorityMultiLocks more gracefully
2023-02-17 10:04:51 -08:00
Steve Atherton a1c804bc87 Added PriorityMultiLock::halt() and used that instead of kill() which avoids broken_promise errors if the lock user does not stop all of its lock-taking actors before destructing the lock and itself. 2023-02-15 23:32:17 -08:00
Steve Atherton 1d01444383 Update StorageBytes::used reported by Redwood to be the physical file size to match the behavior of other storage engines. 2023-02-15 19:02:56 -08:00
Jingyu Zhou fa7f15e46a
Merge pull request #9353 from sfc-gh-yiwu/redwood_restart
Redwood: fix restart test failure with XOR encoding
2023-02-13 09:24:57 -08:00
Steve Atherton 41fa3eada9
Merge branch 'main' into add-redwood-slack-knob 2023-02-12 19:31:20 -08:00
Yi Wu a37d8f757c Redwood: fix restart test failure with xor encoding 2023-02-10 21:01:52 -08:00
Yi Wu f17024e615
Redwood: fix btree unit test reopen memory only pager (#9334)
The Redwood btree test are not suppose to reopen the pager if it is memory only, which will open an empty pager.
2023-02-09 17:12:50 -08:00
Yi Wu d3bc2afc8e
EaR: storage server uses encryption DB config (#9115)
The PR is updating storage server and Redwood to enable encryption based on the encryption mode in DB config, which was previously controlled by a knob. High level changes are
1. Passing encryption mode in DB config to storage server
    1.1 If it is a new storage server, pass the encryption mode through `InitializeStorageRequest`. the encryption mode is pass to Redwood for initialization
    1.2 If it is an existing storage server, on restart the storage server will send `GetStorageServerRejoinInfoRequest` to commit proxy, and commit proxy will return the current encryption mode, which it get from DB config on its own initialization. Storage server will compare the DB config encryption mode to the local storage encryption mode, and fail if they don't match
2. Adding a new `encryptionMode()` method to `IKeyValueStore`, which return a future of local encryption mode of the KV store instance. A KV store supporting encryption would need to persist its own encryption mode, and return the mode via the API.
3. Redwood accepts encryption mode from its constructor. For a new Redwood instance, caller has to specific the encryption mode, which will be stored in Redwood per-instance file header. For existing instance, caller is supposed to not passing the encryption mode, and let Redwood find it out from its own header.
4. Refactoring in Redwood to accommodate the above changes.
2023-02-06 14:02:31 -08:00
Yi Wu 845cc62a39
Redwood: fix tree height overgrowth with per-tenant encryption (#9020)
* Fix Redwood tree height overgrowth when EaR and tenant page split are enabled, by removing the buildNewSubtree() logic.
* Fixing incorrect page upper bound for the last page created by writePages() without the buildNewSubtree() logic.
* Enable tenant page split if encryption mode is domain-aware encryption.
* Related test fixes:
  - In simulation, pass encryption mode to storage/Redwood via knobs. This is a workaround to enable testing with Redwood encryption before we correctly pass the encryption mode via db config. Also temporarily disable tenant page split for restart tests.
  - Disable raw access in FuzzApiCorrectness test if domain-aware encryption is enabled, to avoid test timeout
  - Disable encryption for DrUpgradeRestart test, which is likely to fail due to a rare EKP deadlock issue blocking recovery. Will re-enable after the deadlock issue is fixed.
2023-01-06 15:56:37 -08:00
Yi Wu 5d6ba48da0
Fix /redwood/correctness/EnforceEncodingType unit test (#9095)
The unit test intentionally cause unexpected_encoding_type being thrown, which would hit a simulation only assert failure. Disabling that assert in this case.
2023-01-06 14:13:59 -08:00
Nim Wijetunga 21611761bd
Backup uses DB Config (#8941)
* add encryption db config

* address pr comments

* address pr comments

* add comments

* remove knobs from backup

* remove import

* cp uses db config

* modify simulated cluster

* remove includes

* fix tests

* fix tests

* modify comment

* add encryption enabled method

* change error to warn

* Trigger Build

* Trigger Build

* Trigger Build
2023-01-04 22:43:51 -05:00
Yi Wu 17fdbc46a5
EaR: Add page checksum to Redwood pages in no-auth mode (#8965)
Previously with EaR we always enable authentication (e.g. we encrypt Redwood pages). The authentication is a form of checksum, so dedicated page checksum was not needed. This PR adds back xxhash page checksum when authentication is disabled. Also change the knob to default disable authentication.
2023-01-03 10:30:07 -08:00
imperatorx 81e8afd3a2 Introduce new know for Redwood slack balancing 2022-12-20 15:22:54 +01:00
A.J. Beamon 0a686719d8 Make mapAsync usable without specifying template parameters 2022-12-14 14:33:59 -08:00
sfc-gh-tclinkenbeard 68f14f017c Fix clang 15 compiler warnings 2022-12-08 13:59:37 -08:00
FoundationDB CI 86d6106dc1
format source code after switch to clang 15 2022-12-08 17:26:45 +00:00
Steve Atherton fb45c2ec29 Added explicit shutdown of FIFOQueue operation futures to avoid possible page cache additions after page cache cleanup. 2022-11-28 00:03:21 -08:00
Yi Wu 551fd0b9bb
EAR: Cleanup Redwood tenant map usage (#8902)
We have a recent redesign that no longer required to pass tenant name to get encryption key, and also not allowing optional tenant mode for tenant-aware encryption. This PR clean up Redwood code to remove tenant map usage, and update various checks accordingly.

Changes:
* Cleanup TenantPrefixIndex in TenantAwareEncryptionKeyProvider and related logic in storage server and Redwood for passing the map around.
* Cleanup and update DecodeBoundaryVerifier the reflect the new design.
* A minor fix to writePages() that avoid a page that's default domain encrypted having a lower bound key belonging to a non-default domain.
* Fix TenantAwareEncryptionKeyProvider::getEncryptionDomain() returning wrong prefix long for system domain.
* A minor change to add a context string to IoTimeoutError.
2022-11-23 09:41:40 -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
Markus Pilman 503769ef05
Merge pull request #8496 from sfc-gh-mpilman/bugfixes/machines-attrition-debugging
Enable machine attrition injection
2022-11-15 16:32:33 -07: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
Sam Gwydir 99d4bacf5d Merge remote-tracking branch 'origin/main' into ddsketch 2022-11-15 13:19:42 -08:00
Sam Gwydir 23706c957b Use DDSketch for Sample Data. 2022-11-12 13:45:46 -08:00
Steve Atherton d61b88e6b3 Bug fix, Redwood's ioLock was not a Reference<>. Renamed several knobs, functions, and Redwood metrics for clarity. 2022-11-11 20:07:48 -08:00
Markus Pilman f1fea14255 Merge remote-tracking branch 'origin/main' into bugfixes/machines-attrition-debugging 2022-11-01 13:51:35 -06:00
Steve Atherton 27dc180b68 Merge commit '0ae568a872e474c8c755e648efbbe4524e63e445' into storageserver-pml
# Conflicts:
#	fdbserver/VersionedBTree.actor.cpp
2022-10-24 22:31:36 -07:00
Markus Pilman e7b5b870a3 Merge remote-tracking branch 'origin/main' into bugfixes/machines-attrition-debugging 2022-10-24 15:24:36 -06:00
Markus Pilman 43cafb0bc2 Track disk corruptions and mark resulting failures as injected 2022-10-24 14:54:43 -06:00
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