Commit Graph

808 Commits

Author SHA1 Message Date
Yi Wu 3287098b4a EaR: Handle KMS timeout in storage server and commit proxy 2023-08-28 16:17:43 -07:00
Nim Wijetunga 7f2260bbd2
Add Encryption Related Latency Metrics (#10596)
* add ss and cp latency metrics

* make changes
2023-07-14 11:30:16 -07:00
Evan Tschannen ef682d304e fix IKeyValueStore include 2023-06-16 13:28:40 -07:00
Evan Tschannen eb772c0043 added a blob worker specific page cache size for redwood so that it does not have to be changed manually in fdb.conf for all blob worker processes 2023-06-13 10:35:13 -07:00
Evan Tschannen 359e178dcd Merge branch 'main' into feature-durable-change-feed
# Conflicts:
#	fdbclient/ClientKnobs.cpp
#	fdbserver/BlobManager.actor.cpp
#	fdbserver/worker.actor.cpp
2023-06-11 13:58:35 -07:00
Yanqin Jin 16df5a8517
Make redwood tests terminate after certain amount of time (#10032)
This PR avoids "external timeout" for redwood correctness tests.

Update the logic in fdbserver.actor.cpp so that -1 instead of 0 is considered a noUnseed. If "noUnseed == true", then -1 will be logged as "RandomUnseed" in the end of the trace.

Tweak the finish condition of redwood unit tests so that if wall clock time reaches a certain threshold, finish the test and set nounseed to true.
2023-05-23 21:29:45 -07:00
Evan Tschannen 3dd86d6c22 move IKeyValueStore.h to the client 2023-05-10 15:41:47 -07:00
Jay Zhuang 1c009bbd11 Update value size and maxCommitSize based on pageSize 2023-05-09 09:11:30 -07:00
Jay Zhuang 9f2f735d53 More random keys if there's fewer stringSet 2023-05-09 09:11:30 -07:00
Jay Zhuang 79089ffcf0 Fix an issue that the generator could be empty 2023-05-09 09:11:30 -07:00
Jay Zhuang 1ca85c3874 Fix an assert 2023-05-09 09:11:30 -07:00
Jay Zhuang 561db510e0 Add a helper class to container StringSetGenerator and StringGenerator 2023-05-09 09:11:30 -07:00
Jay Zhuang fd680782b5 Integrate the random key/value generator 2023-05-09 09:11:30 -07:00
Steve Atherton 18468b417c Fix divide by zero. 2023-05-03 00:20:46 -07:00
Steve Atherton 9eaa829626 Make ICloseable()::close() implementations delete the object *before* triggering the onClosed() future. 2023-05-02 19:03:15 -07:00
Steve Atherton cdd7c410fe Sim-only bug fix which only affects BTree unit test. BTree destruction was not explicitly cancelling the lazy delete actor, so an immediate re-open of the instance could cause two AsyncFileWriteCheckers to exist on the same file at the same time. 2023-05-02 18:59:33 -07:00
Jay Zhuang b7da2ed16c Fix RangeResult.readThrough misuse
Fix `RangeResult.readThrough` misuses:
1. KeyValueStores do not need to set readThrough, as it will not be
   serialized and return. Also setting it to the last key of the result
   is not right, it should at least be the keyAfter of the last key;
2. Fix NativeAPI doesn't set `RangeResult.more` in a few places;
3. Avoid `tryGetRange()` setting `readThrough` when `more` is false,
   which was a workaround for the above item 2;
4. `tryGetRangeFromBlob()` doesn't set `more` but set `readThrough` to
   indicate it is end, which was following the same above workaround I
   think. Fixed that.
5. `getRangeStream()` is going to set `more` to true and then let the
   `readThrough` be it's boundary.

Also added readThrough getter/setter function to validate it's usage.
2023-04-17 21:37:51 -07:00
Steve Atherton 9daacb0c2e Merge remote-tracking branch 'origin/main' into replaceRange 2023-04-06 13:18:30 -07:00
Hui Liu 396f89a3f4
Cleanup stale disk files for double recruitment of storage server (#9794) 2023-04-06 12:13:59 -07:00
neethuhaneesha 1d6908d3b4
Changing single key deletions to delete based on number of deletes instead of bytelimit. (#9867) 2023-04-03 13:55:58 -07:00
Jay Zhuang 18fc4f579f Handle the case when range is empty 2023-03-28 13:47:44 -07:00
Jay Zhuang 74254c52c4 Revert "Fix redwood.clear() seg fault when range begin == end"
This reverts commit 85f039e73b5fb4bd3c50e65b7edcc859c3729841.
2023-03-28 13:47:44 -07:00
Jay Zhuang 355677f041 Fix redwood.clear() seg fault when range begin == end 2023-03-28 13:47:44 -07:00
Steve Atherton 117b6c0a6e
After maxColdStarts is hit, stop the test instead of stopping cold starts. (#9783) 2023-03-23 13:50:57 -07:00
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