Commit Graph

20346 Commits

Author SHA1 Message Date
Xiaoxi Wang 6c11fc74ba add debug traces 2022-05-18 15:20:23 -07:00
Ata E Husain Bohra 33ae398268
REST KmsConnector implementation (#6994)
* REST KmsConnector implementation

Description
  diff-1: Address review comments.
          Add utility interface to Platform namespace to
          create and operate on tmpfile
 diff-2: Address review comments
         Link Boost::filesystem to CMake build process

Major changes includes:
1. Implement REST based KmsConnector implementation.
2. Salient features of the connector:
 2.1. Two required configuration are:
   a. Discovery KMS URLs - enable KMS discovery on bootstrap
   b. Endpoint path configuration to construct URI to fetch/refresh
      encryption keys
   c. Configuration to provide "validationTokens" to connect with
      external KMS. Patch implements file-based token validation scheme.
 2.2. On startup, RESTKmsConnector discovers KMS Urls and caches
      them in-memory. Extracts "validationTokens" based on input config.
 2.3. Expose endpoints to allow fetch/refresh of encryption keys.
 2.4. Defines JSON format to interact with external KMS - request &
      response payload format.
3. Extend Platform namespace with an interface to create and operate on
   tmp files.
4. Update Platform 'readFileBytes' and 'writeFileBytes' to leverage
   fstream supported implementation.

NOTE: KMS URLs fetched after initial discovery will be persisted using
      DynamicKnobs. It is TODO at the moment and shall be completed
      once DynamicKnobs is feature complete

Testing

Unit test to validation following:
1. Parsing on "validation tokens" logic.
2. Construction and parsing of REST JSON request and response strings.
2022-05-07 13:18:35 -07:00
Johannes Scheuermann 979c8a783c
Merge pull request #7103 from johscheuer/use-relpath
Make use of relpath instead of basepath
2022-05-07 19:02:00 +01:00
Johannes M. Scheuermann b53c9fe851 Make use of relpath instead of basepath 2022-05-07 13:18:03 +01:00
hao fu 4804bb21cf Fix comments 2022-05-06 18:01:43 -07:00
hao fu c01f680d62 add appendRaw and subTupleRawString for Tuple 2022-05-06 18:01:43 -07:00
Dan Lambright a4c3bf78eb
Merge pull request #7092 from sbodagala/main 2022-05-06 18:40:10 -04:00
Renxuan Wang 14e5fc5f24
Fix compatibility issue. (#7095)
New added field should be the last in serializer.
2022-05-06 14:53:56 -07:00
Xiaoxi Wang 0287e4f0ef
Merge pull request #6946 from sfc-gh-xwang/ppw-store
Show store type in status json and use store type for perpetual wiggle order
2022-05-06 14:44:23 -07:00
Jingyu Zhou 3caa3bc595 Rename variable names 2022-05-06 12:33:19 -07:00
Jingyu Zhou 0cce5feae3 Optimize LogPushData to avoid constructing LogSystemConfig
Which seems to be a CPU hot spot in our testing.
2022-05-06 12:33:19 -07:00
neethuhaneesha 89c2468d0d
Merge pull request #7075 from neethuhaneesha/countersLogging
Adding rocksdb throttling counters to trace event.
2022-05-06 15:29:18 -04:00
Sreenath Bodagala 154ae7559e - If getRange() is called with "latestVersion" as the read version
then both GetKeyValuesFamilyRequest and getRangeFallback should do
reads at the same version.
2022-05-06 18:10:37 +00:00
Johannes M. Scheuermann 410bcc8d5d Format sidecar script 2022-05-06 08:40:18 -07:00
hao fu 24f6276e14 Eliminate vector string during mapped key processing
There was OOM if we pre-process all the strings.
2022-05-06 08:38:27 -07:00
A.J. Beamon 68a46ca14d
Merge pull request #6852 from sfc-gh-jfu/jfu-list-tenants
Add listTenants commands to python and java bindings
2022-05-06 08:37:17 -07:00
Neethu Haneesha Bingi 93f9ea9a5b Adding rocksdb throttling counters to trace event. 2022-05-05 17:42:26 -04:00
Aaron Molitor 19e7b13eb2
Update Badge URL in README.md 2022-05-05 16:34:58 -05:00
Hao Fu f8d3b20994
re-use same arena when construct mapped key (#7066)
* re-use same arena when construct mapped key

ConstructMappedKey seems to be a hotspot, try eliminate unnecessary
operations by
* re-using the same Tuple
* preprocess the formatTuple to get a list of Tuples and strings

* throw  mapper_bad_range_decriptor when range query is not the last element
2022-05-05 12:52:54 -07:00
Jingyu Zhou b970d507c0 Avoid creating LogPushData when PROXY_USE_RESOLVER_PRIVATE_MUTATIONS is off
To save CPU cost, especially for creating LogSystemConfig.
2022-05-05 08:45:40 -07:00
Vaidas Gasiunas 254da4d796
Merge pull request #7065 from sfc-gh-jslocum/arm_bg_fix
Fix for arm BG tests
2022-05-05 11:18:44 +02:00
Yi Wu 66f1c5c85a
Small BlobCipher and SimKmsConnector fixes and changes (#6936)
* SimKmsConnector fix domain id being unsigned
* SimKmsConnector fix returning cipher id 0 as latest key, which is invalid
* SimKmsConnector fix keys initialized as c-style strings with incorrect length and uninitialized bytes
* SimKmsConnector fix returning different keys for the same id after restart
* BlobCipher change APIs to return null reference when key not found
* BlobCipher insertCipherKey to return the inserted key
2022-05-04 14:09:31 -07:00
Hao Fu c1c316591c
Clean up constructMappedKey method (#7062)
* Clean up constructMappedKey method

* fix comments and bugs

* Fix search index

* Fix bug, if escaped is true after first round, it would skip the second round
2022-05-04 13:37:05 -07:00
Jon Fu c001d55c24 push tenant_list result as a packed tuple to stay consistent with other operations 2022-05-04 16:33:46 -04:00
Josh Slocum a7fdb42db8 Fix for arm BG tests 2022-05-04 14:54:16 -05:00
Xiaoxi Wang aa3376ab42 fix comparison typo 2022-05-04 11:45:27 -07:00
Jon Fu b5556c57f9 adjust instruction ordering in tenant_list api for binding tester 2022-05-04 13:59:19 -04:00
Jon Fu 9798e5fc83 Merge branch 'main' of github.com:apple/foundationdb into jfu-list-tenants 2022-05-04 12:49:43 -04:00
Jon Fu 96a35264b4 return tenant_list as one operation and validate with assertions 2022-05-04 12:48:48 -04:00
Dan Lambright e8adad38b0
Merge pull request #7057 from sbodagala/main
Address GRV cache and version vector incompatibility
2022-05-04 10:06:14 -04:00
Trevor Clinkenbeard 0069ce51a5
Merge pull request #7054 from sfc-gh-tclinkenbeard/remove-non-tls-support
Remove `DISABLE_TLS` CMake option
2022-05-03 22:13:07 -07:00
Xiaoxi Wang 75a90be0dd refactor Status retrieval 2022-05-03 15:26:24 -07:00
Sreenath Bodagala 2102ed1eaa - Remove "stale_version_vector" error code. 2022-05-03 21:56:11 +00:00
A.J. Beamon be0c7a8884
Merge pull request #7037 from sfc-gh-ajbeamon/fdbcli-generator-refactor
Move fdbcli command and hint generators into the CommandFactory
2022-05-03 12:52:29 -07:00
Hao Fu 97eb12381b
implement equals and hashCode in MappedKeyValue (#7041) 2022-05-03 12:24:26 -07:00
Sreenath Bodagala 484558250b - Do not consult version vector if the client has obtained the read
version from its GRV cache.
2022-05-03 19:23:37 +00:00
sfc-gh-tclinkenbeard 225146176d Apply clang-format to fdbcli.actor.cpp and Net2.actor.cpp 2022-05-03 12:13:09 -07:00
sfc-gh-tclinkenbeard 258ba462e1 Remove !defined(_WIN32) guards for encryption code 2022-05-03 09:48:24 -07:00
Johannes Scheuermann 9665786785
Merge pull request #7011 from johscheuer/add-is-present-method-sidecar
Add sidecar method to check if a file is present
2022-05-03 07:22:23 +01:00
sfc-gh-tclinkenbeard 06825775db Fix formatting of lines with TLS_OPTION_FLAGS 2022-05-02 22:56:06 -07:00
sfc-gh-tclinkenbeard 8ea68154bf Remove WITH_TLS CMake variable 2022-05-02 22:45:00 -07:00
sfc-gh-tclinkenbeard ea00ae3a25 Remove DISABLE_TLS CMake argument 2022-05-02 22:31:46 -07:00
sfc-gh-tclinkenbeard 475d66084d Remove ENCRYPTION_ENABLED macro 2022-05-02 22:26:31 -07:00
sfc-gh-tclinkenbeard 7f05221cfe Removed TLS_DISABLED macro 2022-05-02 22:15:27 -07:00
Steve Atherton fa02f17932
Merge pull request #7050 from sfc-gh-satherton/redwood-shutdown-hang-fix
Bug fix:  Redwood shutdown would wait for pending IO success
2022-05-02 21:34:13 -07:00
Steve Atherton 9a279c24ae Bug fix: Redwood shutdown would wait for pending IO success so if any of them failed the shutdown would never complete. 2022-05-02 19:26:44 -07:00
Andrew Noyes 90dae38d04
Update RYWIterator test to match #6993 (#7046)
There's a test which checks behavior against a reference implementation,
and so the reference implementation needs to be updated as well.
2022-05-02 18:22:59 -07:00
Jingyu Zhou 05e63bc703
Fix orphaned storage server due to force recovery (#6914)
* Fix orphaned storage server due to force recovery

The force recovery can roll back the transaction that adds a storage server.
However, the storage server may now at version B > A, the recovery version.
As a result, its peek to buddy TLog won't return TLogPeekReply::popped to
trigger its exit, and instead getting a higher version C > B back. To the
storage server, this means the message is empty, thus not removing itself and
keeps peeking.

The fix is to instead of using recovery version as the popped version for the
SS, we use the recovery transaction version, which is the first transaction
after the recovery. Force recovery bumps this version to a much higher version
than the SS's version. So the TLog would set TLogPeekReply::popped to trigger
the storage server exit.

* Fix tlog peek to disallow return empty message between recoveredAt and recovery txn version

This contract today is not explicitly set and can cause storage server to fail
with assertion "rollbackVersion >= data->storageVersion()". This is because if
such an empty version is returned, SS may advance its storage version to a
value larger than the rollback version set in the recovery transaction.

The fix is to block peek reply until recovery transaction has been received.

* Move recoveryTxnReceived to be per LogData

This is because a shared TLog can have a first generation TLog which is already
setting the promise, thus later generations won't wait for the recovery version.
For the current generation, all peeks need to wait, while for older generations,
there is no need to wait (by checking if they are stopped).

* For initial commit, poppedVersion needs to be at least 2

To get rid of the previous unsuccessful recovery's recruited seed
storage servers.
2022-05-02 17:17:37 -07:00
Hao Fu fa2e85f1d3
Add comment about getMappedRange parameters (#7044) 2022-05-02 15:17:14 -07:00
Andrew Noyes 7ed82c1ac5
Mac m1 has 16k pages (#7038)
Previously the page guard implementation assumed that the page size was
4k. Also check for mmap and mprotect returning errors.
2022-05-02 14:24:43 -07:00