1
0
mirror of https://github.com/apple/foundationdb.git synced 2025-05-28 10:52:03 +08:00

67 Commits

Author SHA1 Message Date
Xiaoxi Wang
070894a597 return early if streams is empty 2022-12-15 12:56:49 -08:00
Nim Wijetunga
a21f657429
Add Encryption Code Probes for BlobGranule ()
* add code probes

* address pr comments

* address pr comments

* Trigger Build

* fix
2022-11-16 06:13:55 -08:00
Hui Liu
0f8e5af5cf Add micro-benchmark for blob delta serialization 2022-11-11 09:22:11 -08:00
Josh Slocum
494dd1c5ed
switch bg file data chunks to be serialized with binary writer instead of object writer () 2022-11-03 16:42:36 -05:00
Nim Wijetunga
24ce8c0fd0
Commit Proxy Encryption Code Probes ()
* add commit proxy encryption code probes

* fix comment

* address pr comments

* address pr comments

* address pr comments

* address pr comments

* Trigger Build
2022-10-31 20:04:42 -07:00
Josh Slocum
2d6840ee90
fix bg stats invalid access () 2022-10-24 10:23:22 -07:00
Josh Slocum
9987da5a4f
Add blob granule benchmark to track stats by varying amount of deltas, and several simple perf improvements () 2022-10-21 17:05:51 -05:00
Josh Slocum
d7b88f203c
added repeatFromFiles that supports new file format () 2022-10-21 10:29:35 -05:00
Josh Slocum
89519343a7
adding new bg read metrics to client and refactoring them into a new trace event () 2022-10-18 14:13:35 -05:00
A.J. Beamon
e1fe28b78b Switch some usages of LiteralStringRef to use the _sr suffix 2022-09-30 16:04:16 -07:00
Hui Liu
db3b908ce2
Merge pull request from sfc-gh-huliu/fixunittest
fix benchFromFiles unit test
2022-09-29 22:15:56 -07:00
Hui Liu
dea6da142d fix unittest benchFromFiles 2022-09-29 21:00:12 -07:00
Ata E Husain Bohra
03f1d13be3
Enable encryption authentication configurability ()
* Enable encryption authentication configurability

Description

 diff-1: Remove memcpy due to auth-token computation
         Address review comments

Patch proposes major changes:
1. Enable FDB to choose encryption authentication as a configurable
parameter. Fix issues choosing ENCRYPT_HEADER_AUTH_TOKEN_NONE mode.
2. Introduce AES_CMAC as supported encryption authentication scheme.

Patch allows cluster to govern: if encryption authentication needs to
enabled, if yes, then choose from two supported schemes:
1. HMAC_SHA_256
2. AES_256_CMAC

Testing

devRunCorrectness - 100K
BlobCipher unittests
EncryptionOps.toml
BlobGranuleCorrectness/BlobGranuleCorrectnessClean
2022-09-29 16:18:55 -07:00
Josh Slocum
f78eb8c778
Adding bg read amp metrics () 2022-09-22 16:31:27 -07:00
Ata E Husain Bohra
52169d2b8e
Enable ZSTD compression support ()
* Enable ZSTD compression filter

Description

  diff-4: Randomize Knob Compression filter selection
  diff-3: Minor refactoring
  diff-2: Limit ZSTD availability to CLANG compiler
  diff-1: Add ZSTD compression option to BlobGranule tests

Major changes includes:
1. Update FDB CMake to download, install and build Boost with
ZSTD compatibility
2. Update CompressionUtils to enable boost::iostreams::zstd
compression filter

Testing

CompressionUtilsUnit.toml
BlobGranuleCorrectness/BlobGranuleCorrectnessClean
devRunCorrectness - 100K (in-progress)
2022-09-22 14:31:49 -07:00
A.J. Beamon
4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
Josh Slocum
4ead9a697f cleaning tss and blob granule file code probes 2022-09-16 09:51:33 -05:00
Yi Wu
d831c87d14
Add encryption metrics ()
Adding the following metrics:
* BlobCipherKeyCache hit/miss
* EKP: KMS requests latencies
* For each component that using encryption, they now need to pass a UsageType enum to the encryption helper methods (GetEncryptCipherKeys/GetLatestEncryptCipherKey/encrypt/decrypt) and those methods will help to log get cipher key latency samples and encryption/decryption cpu times accordingly.
2022-09-09 18:43:09 -07:00
Josh Slocum
a27ee0f18a
Fixing UBSAN issues in BlobGranuleFiles () 2022-08-25 10:25:50 +02:00
Josh Slocum
cfc5ab550e
Update BlobGranules API tests ()
* blob granule fixes from api tests

* Adding BlobGranuleErrors workload

* bug fixes and debugging improvements for blob granule api tests

* cleanup and refactoring of bg api tests

* better memory management for loadAndMaterialize
2022-08-23 17:47:02 -05:00
Josh Slocum
98a7ec1797
Blob Granules Cleanup ()
* Cleaned up BlobGranule TODO + FIXMEs and addressed some

* popping feed at correct version

* blob worker taking over a granule will pop from where previous worker left off

* addressed fixme of blob worker not re-snapshotting from old change feed

* formatting

* more change feed popped fixes after pop updates

* Getting rid of change feed parallelism lock since it can cause deadlocks in fetching, and relying on full fetch lock

* New blob worker metric and fixing old one

* server-side popped checking still doesn't work because of pops at non-mutation versions

* format
2022-08-19 17:25:31 -07:00
Ata E Husain Bohra
03435b5133
Update BlobCipher cache to respect EKP/KMS cipherKey TTL ()
Description

FDB native encryption data at-rest supports two type of cipher-keys
in-memory caching:
1. Revocable keys - with a definite expiry (future timestamp)
2. Non-revocable keys - with or without expiry timestamp and/or
refreshAt timestamp.

Patch update BlobCipherKey in-memory cache to respect EKP/KMS
supplied 'refreshAt' and 'expireAt' timestamp. GetLatestCipher
validates `cipher key freshness' as well as GetCipherKey checks
for 'cipher key liveness' before replying details to the caller.

Patch also optimizes the BlobCipher module logging by taking
following measures:
1. BLOB_CIPHER_DEBUG macro to guard spammy log messages needed
mostly for debugging failures.
2. Minimize log volume by logging cipherKey details for any new
key added to the cache, key-refreshes are not logged.
3. Categorize logs into: debug, info and warn on per-usecase basis

Testing

devRunCorrectness - 100K
EncryptOps.toml - 100K
2022-08-15 11:17:26 -07:00
Josh Slocum
62494f048c
several changes to manage blob worker memory more and to test that management () 2022-08-09 17:53:52 -05:00
Josh Slocum
4b66645d80
Granule file performance benchmark and improvements ()
* added cpu microbenchmark for blob granule files

* Added edge case read benchmarks, and sorting memory deltas

* Sorted merge for granule files

* key block comparison optimization in granule files

* More performance improvements to granule file read

* fixing zlib not supported build

* fixing formatting

* Added debug macro for new debugging prints

* review comments

* more strict compression size validation assert
2022-08-02 11:36:44 -05:00
Ata E Husain Bohra
ef6012c1d1
Encrypt BlobGranule delta files ()
* Encrypt  BlobGranule delta files

Description

 diff-1: Address review comments

Major changes proposed by the patch are:
1. Refactor code to allow caching of 'encryption key ctx' as part of
BlobFilePointerRef. The refactoring allows snapshot and/or delta files
to store their own file encryption context.
2. Enable BlobGranule delta file encryption/decryption semantics.

Testing

BlobGranuleCorrrectness  
BlobGranuleCorrectnessClean
BlobGranuleFileUnitTestToml

Description

Testing
2022-08-01 16:34:44 -07:00
Junhyun Shim
c6342a6e5b
Merge branch 'main' into features/authz 2022-07-27 20:51:32 +02:00
Junhyun Shim
5169616b16 Fix unresolved merge conflicts 2022-07-27 00:38:16 +02:00
Josh Slocum
0609aa57d1 Merge branch 'main' into improved_cf_testing 2022-07-26 16:44:13 -05:00
Josh Slocum
15e7a4b186 addressing review comments 2022-07-26 14:20:35 -05:00
Josh Slocum
ea9018460a cleanup and polish 2022-07-22 15:13:32 -05:00
Josh Slocum
33053a0a7a Bug fix and cleanup 2022-07-22 14:34:38 -05:00
Josh Slocum
095a5a4868 First version of key-sorted delta files 2022-07-22 11:43:49 -05:00
Josh Slocum
80f4c059f1 Added full granule read unit test 2022-07-21 14:14:01 -05:00
Josh Slocum
d4a2f39743 Completed delta format unit test 2022-07-21 12:40:38 -05:00
Josh Slocum
6fc0d61146 delta file test and delta generation 2022-07-21 11:49:13 -05:00
Josh Slocum
16e63578c3 Refactoring and adding to BlobGranuleFiles data generation 2022-07-21 09:47:11 -05:00
Josh Slocum
2a0381f44d
Merge pull request from sfc-gh-ahusain/ahusain-fix-test
Fix snapshotFormatUnitTest infinite loop
2022-07-20 14:17:39 -05:00
Josh Slocum
5540f92e2e Refactoring randomExp to the proper place 2022-07-20 08:36:03 -05:00
Ata E Husain Bohra
3acba4e5d7 Fix snapshotFormatUnitTest infinite loop
Patch addresses an issue where loop generating random buffer
for the test might run in an infinite loop if KeySpace gets
exhausted but the 'targetBuffer' bytes aren't generated.

Description

Testing
2022-07-15 14:34:33 -07:00
Ata E Husain Bohra
05e7f34c80 BlobFile Encryption and compression support
Fix windows CI build issue.

Description

Testing
2022-07-15 11:04:02 -07:00
Ata E Husain Bohra
f6f117592d BlobFile Encryption and compression support
- Limit verbose logging under DEBUG_MACRO
 - Update/Add code documentation

Description

Testing
2022-07-14 17:04:14 -07:00
Ata E Husain Bohra
3a3811d6cc BlobFile Encryption and compression support
Few fixes
 - Update BlobGranuleCipherKeysMeta to use 'std::string' to
   persist 'Initialization Vector'
 - Update WriteSnapshot to persist 'BlobGranuleCipherKeysMeta' as part
   of BlobFileIndex

Description

Testing
2022-07-14 17:04:14 -07:00
Ata E Husain Bohra
24b2de8de8 BlobFile Encryption and compression support
Description

Testing
2022-07-14 17:04:14 -07:00
Josh Slocum
b85fbaef52
Merge pull request from sfc-gh-jslocum/bg_file_chunking
Chunked Snapshot Files
2022-07-13 17:22:34 -05:00
Josh Slocum
0b0ac16a4c Merge branch 'main' into granule_merging 2022-07-12 09:09:30 -05:00
Josh Slocum
9e64037b25 Merge branch 'main' into bg_file_chunking 2022-06-30 17:13:02 -05:00
Markus Pilman
d35445a868 enforce include modularization in cmake 2022-06-23 14:37:35 -06:00
Josh Slocum
29c04cf3e1 Refactored BG File structs from discussion 2022-06-17 11:24:00 -05:00
Josh Slocum
3f871f4123 Chunked Snapshot Files passes unit test 2022-06-15 14:52:28 -05:00
Josh Slocum
d6920cde28 Implemented blob granule merging 2022-06-09 10:50:53 -05:00