Commit Graph

479 Commits

Author SHA1 Message Date
Jingyu Zhou deda04b845
Fix a restore bug due to a race (#12037)
Found by simulation:
seed:  -f tests/slow/ApiCorrectnessAtomicRestore.toml -s 177856328 -b on
Commit: 51ad8428e0
Compiler: clang++
Env: Rhel9 okteto

applyMutations() has processed version 801400000-803141392, and before calling sendCommitTransactionRequest(),
which was going to update apply begin version to 803141392. But DID NOT wait for the transaction commit.

Then there is an update on the apply end version to 845345760, which picks up the PREVIOUS apply begin version 801400000.
Thus started another applyMutation() with version range 801400000-845345760. Note because previous
applyMutation() has finished and didn't wait for the transaction commit, thus the starting version
is wrong. As a result, this applyMutation() re-processed version range 801400000-803141392.

The test failed during re-processing, because mutations are missing for the overlapped range.

The fix is to wait for the transaction to commit in sendCommitTransactionRequest().

This bug probably affects DR as well.

See rdar://146877552

20250317-162835-jzhou-ff4c4d6d7c51bfed
2025-03-17 16:12:33 -07:00
Jingyu Zhou 8cd90ee7d0 Holds onto temporary variables' memories
Otherwise, StringRef points to free'ed memory locations.
2025-02-10 14:45:24 -08:00
hao fu 93133c83fb address comments 2025-01-23 12:32:27 -08:00
hao fu 933b035729 Refactor backup mutation serialization 2025-01-23 08:52:18 -08:00
flowguru fe47ce24d3
New restore consolidated commit (#11901)
* New restore consolidated commit

This change adds RestoreDispatchPartitionedTaskFunc to restore
from partitioned-format backup.

* ArenaBlock::totalSize parameter pass by ref

* Fix format issues identified by CI
2025-01-22 14:54:55 -08:00
Syed Paymaan Raza 48064f6cf1
Make some codeprobes rare (#11607)
* Make BlobGranule code probes rare

* Make encryption related code probes rare

* fixup! Fix formatting
2024-08-26 22:33:38 -07:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Hao Fu 9b17dd8caf
Fix backup workers stability issues (#11044)
This PR includes a few stability fixes for Backup Worker

* Fixed memory bookkeeping issue in Backup Worker. Previously
it didn't release flow lock correctly when erasing messages.

* Added TLogServer fix to return 0 from poppedVersion() for
unrecognized log router tags.
2023-11-13 15:55:25 -08:00
Hao Fu 6d9c53f8c4 Add proxy to backup agent via global var
backup agent itself does not have proxy info.
This changes adds the proxy via a global var.
2023-09-08 10:27:01 -07:00
Hui Liu 00d3062728
Initialize apply mutations map for restore to version (#10857) 2023-09-05 10:03:35 -07:00
Ata E Husain Bohra 7779c908b3
EaR: Remove usage of ENABLE_CONFIGURABLE_ENCRYPTION knob (#10570)
Description

Given Configurable encryption has been checked in and being tested via
simulation for more than a month and also to avoid penalty of accessing
KNOBS in inline commit path, patch retires the KNOB and make
ConfigurationEncryption default EaR mode for FDB.

BlobCipher still supports the old format header and encryption semantics,
will remove the dead code as a followup PR.

Testing

devRunCorrectness - 100K
2023-06-30 17:48:09 -07:00
Hui Liu af20493ad0
Move lastFlushTs to BlobGranuleBackupConfig (#10505) 2023-06-16 16:12:10 -07:00
Hui Liu 606d8db75f
Remove blobGranuleLockKeys after blob granule restore (#10477) 2023-06-14 12:41:42 -07:00
Hui Liu ef93caf344
BlobGranuleRestore - skip muations applying if restore target version is less than begin version (#10442) 2023-06-08 09:19:25 -07:00
w41ter abd23958c2 Fix restore range loss 2023-05-29 11:39:07 +08:00
Hui Liu 7ca13d8f9c
support blob restore in fdbrestore (#10248) 2023-05-19 14:45:14 -07:00
Jefferson Zhong 3760522dc2 Make stepSize configurable for preloadApplyMutationsKeyVersionMap 2023-05-19 10:57:30 -07:00
Hui Liu 53e68065e7
Support blob manifest backup for fdbbackup cmdline (#10091) 2023-05-08 16:07:22 -07:00
Steve Atherton 46cde666a5 Merge commit '9639192a88001043a104aeef0c394e99ca5d6a6e' into keybackedrangemap 2023-04-21 13:27:15 -07:00
Nim Wijetunga 021bdccc32
propogate encryption errors properly (#10012)
propogate encryption errors properly
2023-04-19 11:35:29 -07:00
Steve Atherton 53ee26d758 Changed KeyBackedTypes to an actor file. Added TypedKeySelectors for Map and Set classes and getRange() keySelector methods. Added debug macro for KeyBackedTypes. Rewrote KeyBackedRangeMap using keyselectors on KeyBackedMap. 2023-04-18 22:21:19 -07:00
Hui Liu 711e040627
RestoreConfig - use restoreRangeSet to replace restoreRanges (#9912) 2023-04-06 11:16:05 -07:00
Nim Wijetunga 6e4e6ab2f4
Revert "Revert "Refactor GetEncryptCipherKeys (#9600)"" (#9903)
* Revert "Revert "Refactor GetEncryptCipherKeys (#9600)" (#9708)"
2023-04-05 10:03:48 -07:00
A.J. Beamon 64b6a5d257 Allow boolean parameters to be nested inside of namespaces or classes 2023-03-30 15:09:59 -07:00
Ata E Husain Bohra dbcab0b1bd
Revert "Refactor GetEncryptCipherKeys (#9600)" (#9708)
This reverts commit 2702665e35.
2023-03-15 12:10:08 -07:00
Nim Wijetunga 2702665e35
Refactor GetEncryptCipherKeys (#9600)
* inital commit

* address pr comments
2023-03-08 17:05:03 -08:00
Nim Wijetunga 218ed4519f
Strengthen Snapshot Backup/Restore Asserts (#9552)
strengthen backup/restore asserts for encryption
2023-03-08 15:24:02 -08:00
Jingyu Zhou ee5154f478 Refactor decoder to read file as a whole once
To reduce the number of network requests.
2023-03-03 09:32:12 -08:00
Jingyu Zhou ad778cbe5e Merge branch 'main' of https://github.com/apple/foundationdb into fix 2023-03-02 09:56:30 -08:00
Ata E Husain Bohra 2db1da26d9
EaR: Update ApiWorkload to validate encryption at-rest guarantees (#9466)
* EaR: Update ApiWorkload to validate encryption at-rest guarantees

Description

FDB encryption data at-rest guarantees if cluster is configured with feature
enabled, all data written to persistent disks shall be "encrypted". Given FDB
maintains multiple persistent storages during lifecycle of the data, the patch
proposes a scheme to validate the invariant via "simulation testing"

Patch proposes updating ApiCorrectness workload to do the following:
1. Client supplied params and/randomly enable the validation feature.
2. Validation when enabled, allows injecting a known "marker string"
to workload generated Key and Value data patterns.
3. On shutdown, if the validation is enabled, all test files are
scanned for the known "marker" pattern.

Simulation tests are already capable of doing the following:
1. Randomly select TenantMode (disabled/optional/required)
2. Randomly select EncryptionAtRestMode (cluster_aware/domain_aware)

Hence, the updates test all possible combinations are validated. Also,
'defaultTenant' is present to cover 'domain_aware' encryption use cases.

Testing
devRunCorrectness
devRetryCorrectness - ApiCorrectness & EncryptedBackupCorrectness
2023-02-27 21:40:46 -08:00
Jingyu Zhou 1313a7fa25 Use KeyspaceSnapshotFile to filter range files 2023-02-27 19:41:08 -08:00
Vishesh Yadav dd0ea8b0cf Clang-format 2023-02-27 13:10:19 -08:00
Vishesh Yadav 3e6e31ad0b Use the RangeMapFilters 2023-02-27 13:08:55 -08:00
Jingyu Zhou dd4bc82862 Refactor code 2023-02-27 13:06:01 -08:00
Jingyu Zhou 46fce2710e Use RangeMap for backup agent filtering
This is more efficient than going through ranges one by one.
2023-02-27 12:21:52 -08:00
Nim Wijetunga 29819b0645
Change Feed Bug Fix + Encryption Asserts (#9457)
* add encryption asserts

* modify function name

* address pr comments

* address pr comments

* Trigger Build
2023-02-23 19:33:25 -08:00
Nim Wijetunga e03eca778c
Configurable Encryption Support for Backup (#9375)
Snapshot backup configurable encryption support
2023-02-16 15:03:27 -08:00
Ata E Husain Bohra 8c94b340ce
EaR: Update encryption methods to make 'cipherHeaderKey' optional (#9378)
* EaR: Update encryption methods to make 'cipherHeaderKey' optional

Description

 diff-1: Address review comments

Major changes includes:
1. Update BlobCipher Encrypt/Decrypt classes to make 'headerCipher' optional
2. Update GetEncryptionCipherKeys actor methods to make 'headerCipherKey' optional
3. Update the usage across all encryption participant methods

Testing

BlobCipherUnitTest
EnryptedBackupCorrecctness
BlobGranuleCorrectness*

devRunCorrectness - 100K
2023-02-15 08:56:11 -08:00
Yi Wu fe18c87ac6
EaR: commit proxy fetch additional cipher keys post-resolution (#9308)
Commit proxy needs to fetch additional cipher keys post-resolution, since tenant ids for raw access requests and cross-tenant clear ranges are calculated after resolution.
2023-02-14 13:05:51 -08:00
Nim Wijetunga 1cd0922ed1
Snapshot Backup Bug Fix (#9319)
snapshot restore bug fix
2023-02-07 18:44:03 -08:00
Nim Wijetunga 86f3665514
Handle EKP Tenant Not Found Errors (#9261)
handle EKP tenant not found errors
2023-02-01 19:15:38 -08:00
Nim Wijetunga 05a8a90830
Snapshot Backup Tenant Deletion Support (#9145)
Tenant deletion support for snapshot backups
2023-01-26 17:46:14 -08:00
Nim Wijetunga 330ac71630
Tenant Deletion Support for Backup Mutation Log (#9103)
tenant deletion support for backup mutation log
2023-01-18 15:11:58 -08:00
sfc-gh-tclinkenbeard ca9464ae23 Remove rare code probe annotation for forcing restore at larger version 2023-01-18 11:39:02 -08:00
Hui Liu 8d8cba5745 Add correct test for blob restore with large workload 2023-01-18 09:27:48 -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
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
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
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