Commit Graph

3470 Commits

Author SHA1 Message Date
Fuheng Zhao 105c4e5236
Merge branch 'apple:main' into RedwoodIOLaunchLimit 2022-09-06 09:38:06 -07:00
Fuheng Zhao 91219a4a28 sync 2022-09-06 09:37:00 -07:00
Junhyun Shim f2e68d0566
Merge pull request #8102 from sfc-gh-jshim/fdbcli-tls-connect
Make FDBCLI check coordinator :tls suffix
2022-09-06 16:17:49 +02:00
Junhyun Shim 738a101a58 Add test for fdbcli's coordinator TLS suffix check 2022-09-05 19:27:22 +02:00
Vaidas Gasiunas 8ca8691837 ApiVersion: Minor clean ups 2022-09-05 10:42:42 +02:00
sfc-gh-tclinkenbeard 3dec9749d3 Mark PromiseStream::send non-const 2022-09-02 10:41:56 -07:00
He Liu 033741daab Audit should always complete, any failures are retried. 2022-09-02 09:11:19 -07:00
Dennis Zhou 80a0816157
flow: switch from hard coded to ApiVersion like ProtocolVersion (#8071)
* flow: add ApiVersion to replace hard coding api version

Instead of hard coding api value, let's rely on feature versions akin to
ProtocolVersion.

* ApiVersion: remove use of -1 for latest and use LATEST_VERSION
2022-09-02 09:28:13 +02:00
Fuheng Zhao c7f7544231 Merge remote-tracking branch 'upstream/main' into RedwoodIOLaunchLimit 2022-09-01 14:53:11 -07:00
Andrew Noyes 475ed4b1dc
Improve memory safety (#8069)
* Move arena members to the end of serializer calls

See
https://github.com/apple/foundationdb/tree/main/flow#flatbuffersobjectserializer
for why this is necessary.

* Fix a heap-use-after-free

Previously memory owned by
EncryptKeyProxyData::baseCipherDomainIdKeyIdCache was borrowed by a call
to EncryptKeyProxyData::insertIntoBaseDomainIdCache where it was
invalidated and then used. Now
EncryptKeyProxyData::insertIntoBaseDomainIdCache takes shared ownership
by taking a Standalone.

And also rename some types to end in Ref to follow the flow conventions
described here: https://github.com/apple/foundationdb/tree/main/flow#arenas
2022-09-01 12:47:03 -07:00
Xiaoxi Wang b18561bc31 Merge branch 'main' of https://github.com/apple/foundationdb into feature/dd-refactor-simple 2022-09-01 09:29:30 -07:00
Fuheng Zhao 0aa096dc17 sync with upstream main 2022-08-31 15:46:39 -07:00
Josh Slocum d90cdcc498
Adding new retryable error type for blob granule requests (#8023) 2022-08-30 15:07:10 +02:00
Junhyun Shim ac6889286c
Merge pull request #7731 from sfc-gh-jshim/authz-general-tls-and-integration-test
Authz general tls and integration test
2022-08-30 02:19:11 +02:00
Xiaoxi Wang 04c8f28ecd Merge branch 'main' of https://github.com/apple/foundationdb into feature/dd-refactor-simple 2022-08-29 14:59:48 -07:00
Dennis Zhou cd06f8b0f1
Merge pull request #8013 from sfc-gh-dzhou/patch-version
flow: move the protocol version least significant bit mask to cmake
2022-08-29 12:14:40 -07:00
Junhyun Shim f7ef5edab4 Merge remote-tracking branch 'origin/main' into authz-general-tls-and-integration-test 2022-08-29 16:35:57 +02:00
Junhyun Shim 71486cccb1
Make envvar access in envvar-knob parsing cross-platform (#7999)
* Make envvar access in envvar-knob parsing cross-platform

Variable `environ' is defined for Linux,
does not exist in Mac, and is deprecated in Windows

* Prevent env knob strings from being copied at each iteration

* Add headers for {Get|Free}EnvironmentStrings()

* Adjust for different memory layout of environ vs GetEnvironmentStrings()

GetEnvironmentStrings returns a single byte string
with adjacent key=value strings delimited with null bytes,
whereas environ is an array of key=value strings.

* Fix missing return value for Windows build

* Have just one return statement
2022-08-29 14:15:03 +02:00
Dennis Zhou cf73a14e8c flow: move the protocol version least significant bit mask to cmake 2022-08-26 22:09:51 -07:00
Junhyun Shim c2f577dac8 Add key type and DS algorithm dimension to TokenSign benchmark
Also
- Measure performance with RSA keys
- Make RSA key 2048 > 4096 bits
2022-08-26 22:58:36 +02:00
Markus Pilman 98039f6ca1 Merge remote-tracking branch 'origin/main' into features/new-test-harness 2022-08-26 13:52:25 -06:00
Junhyun Shim 6bcfbf421e Merge remote-tracking branch 'origin/main' into authz-general-tls-and-integration-test 2022-08-26 09:20:31 +02:00
Dennis Zhou c8ded2556a flow: allow for patch version to be set again for protocol version
While only major and minor version matters for fdb releases regarding
protocol version, this makes testing a little bit easier.
2022-08-25 12:50:34 -07:00
Jingyu Zhou c2c2b9553b
Merge pull request #7765 from apple/env
Set knobs using environment variables when running Joshua
2022-08-25 11:42:57 -07:00
Ata E Husain Bohra 00fe4863b6
Implement TenantCacheEntry in-memory cache (#7801)
* Implement TenantCacheEntry in-memory cache

Description

  diff-4: TraceEvent usage improvements 
  diff-3: Address review comments
  diff-2: Add APIs to read counter values, test improvements
  diff-1: Address review comments

Major changes includes:
1. Implements an actor that enables an in-memory caching of
TenantCacheEntry object, allowing the caller to embed custom
information along with TenantCacheEntry.
2. The cache follows read-through cache semantics where the entry
gets loaded from underlying database on a miss.
3. The cache implements a "periodic poller" to refresh known Tenants
by consulting the database. Once a database keyrange-watch feature is
available, cache shall be updated.

Bonus:
Implement a 'recurringAsync' addition to genericActors allowing caller
to schedule a periodic task registering an "actor functor"; the routine
'waits' for the actor unlike existing 'recurring' implementation.

Testing

TenantEntryCache workload
devCorrectnessRun - 100K
2022-08-25 11:42:26 -07:00
Dennis Zhou 364be0bc78
Merge pull request #7977 from sfc-gh-dzhou/versioning
flow: move protocol versions to a cmake generated file
2022-08-24 14:16:47 -07:00
Dennis Zhou 932ea74a63 flow: move protocol versions to a cmake generated file 2022-08-24 12:24:01 -07:00
Dan Lambright a61d9d1cd2 Merge remote-tracking branch 'origin' into env 2022-08-24 13:06:47 -04:00
Chaoguang Lin 06aa6ee5ff
Add system monitor for flowprocess (#6925)
* Update network address in trace logs; Add system monitor for flowprocess

* Create a new trace file with the correct process address for flowprocess

* Remove unused debugging traces

* Add a new error lock_file_failure; Change please_reboot_remote_kv_store to please_reboot_kv_store; Add the code to only reboot the kv store but not the worker; Remove some unnecessay traces

* Add error handling for file_not_found in handleIOErrors

* Format worker.actor.cpp file
2022-08-24 00:40:38 -07:00
Trevor Clinkenbeard c41e6090f6
Merge pull request #7624 from sfc-gh-dadkins/sfc-gh-dadkins/bugs/7619
Fix parsing of knob values to reject invalid values.
2022-08-23 22:43:08 -07:00
Dan Lambright 50be189a0f Merge remote-tracking branch 'origin' into env 2022-08-23 17:01:48 -04:00
Marian Dvorsky 3a53ec3115
Call getTraceThreadId() before we enable allocation tracing (#7888) 2022-08-23 20:25:08 +02:00
Junhyun Shim 964dec9b91 Fix incorrect clang format 2022-08-23 19:48:02 +02:00
Trevor Clinkenbeard e83b21d21f
Mark value maybe_unused in /flow/Knobs/ParseKnobValue 2022-08-23 10:16:16 -07:00
Junhyun Shim c21d8830a2 Revert "Apply clang format"
This reverts commit 11b8be6f3d.
2022-08-23 19:12:57 +02:00
Junhyun Shim 11b8be6f3d Apply clang format 2022-08-23 19:05:45 +02:00
Junhyun Shim 8706833355 Further clang-format Net2.actor.cpp 2022-08-23 18:24:11 +02:00
Junhyun Shim de2e51877f Clang format Net2.actor.cpp 2022-08-23 18:00:24 +02:00
Markus Pilman 180024b76d implemented testClass and testPriority 2022-08-22 09:57:44 -06:00
Xiaoxi Wang 5c2b846fbd solve conflicts in upstream/main 2022-08-19 15:36:17 -07:00
He Liu 7cca369f66 Implemented validateRangeAgainstServer. 2022-08-17 16:51:41 -07:00
Junhyun Shim a312002333 Merge remote-tracking branch 'origin/main' into authz-general-tls-and-integration-test 2022-08-17 17:32:00 +02:00
Junhyun Shim bcb9bc7e62 Set up authz integration test environment using Python venv
Add Authz-related support to {tmp|local}_cluster.py
Also fix public key set load/refresh mechanism
2022-08-17 14:57:05 +02:00
Mohamed Oulmahdi c8741385b2 Fix Windows build broken by #7823 2022-08-16 15:39:24 +02:00
Xiaoxi Wang c9f94264f0 merge upstream/main 2022-08-15 13:30:38 -07:00
Markus Pilman 18aa638951
Merge pull request #7877 from sfc-gh-mdvorsky/mdvorsky/fix_net2_unittest
Fix Net2 unittest flakiness
2022-08-15 13:58:40 -06:00
Fuheng Zhao 70ae255744 add Redwood PML metrics 2022-08-15 11:34:09 -07:00
Ata E Husain Bohra 03435b5133
Update BlobCipher cache to respect EKP/KMS cipherKey TTL (#7885)
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
Xiaoxi Wang 806821ef30 merge upstream/main 2022-08-15 10:46:38 -07:00
Marian Dvorsky 8e6009427e Fix Net2 unittest flakiness 2022-08-13 18:51:30 +02:00
Xiaoxi Wang 9133d4e16d
Merge pull request #7803 from sfc-gh-xwang/feature/main/ddvisibility
Add server selection counter in DDQueue
2022-08-12 15:10:25 -07:00
Jingyu Zhou aa29de8d4c
Merge pull request #7838 from xis19/proxyerror
Split the proxy_memory_limit_exceeded to commit/grv version
2022-08-12 10:16:06 -07:00
Junhyun Shim 3cf0914ce0 Fix incorrect parenthesis 2022-08-12 13:52:50 +02:00
Junhyun Shim 312d3da040 Merge remote-tracking branch 'origin/main' into fix-skewed-u32-out-of-range 2022-08-12 13:01:43 +02:00
Junhyun Shim e57d3a6f9b Address review comments 2022-08-12 10:24:23 +02:00
Xiaoge Su 0326d53965 Split proxy_memory_limit_exceeded to commit/grv specific exceptions
Currently GRV is reporting proxy_memory_limit_exceeded error which has
error message claiming Commit proxy failing. This split should remove
such confusion.
2022-08-12 00:45:57 -07:00
Josh Slocum 44f8bdd258
Blob Worker memory limit (#7858)
* Simulation version of blob_worker_full

* tracking blocked BM assignments

* actual memory estimation implementation
2022-08-11 15:07:08 -07:00
Trevor Clinkenbeard 583021c2d9
Merge pull request #7772 from sfc-gh-tclinkenbeard/global-tag-throttling6
Add status section for global tag throttler
2022-08-11 17:38:31 -03:00
A.J. Beamon a41f8d2354
Merge pull request #7768 from sfc-gh-ajbeamon/metacluster-api-changes
Metacluster metadata changes
2022-08-10 13:19:58 -07:00
Xiaoxi Wang 1cff154adb Merge branch 'main' of https://github.com/apple/foundationdb into feature/main/ddvisibility 2022-08-10 12:03:42 -07:00
Xiaoxi Wang ea0c60381f merge upstream/main 2022-08-09 12:28:57 -07:00
Arjun Sharda e89b077b97
Update ParseTree.cs 2022-08-09 14:27:48 -05:00
Arjun Sharda dfdfe3f9a1
Update Program.cs 2022-08-09 14:27:37 -05:00
Arjun Sharda 0dce3e5d91
Update ActorCompiler.cs 2022-08-09 14:27:15 -05:00
A.J. Beamon cd82f65ef5 Change the data cluster entry to use a state field rather than a locked boolean 2022-08-09 11:53:57 -07:00
Markus Pilman 69744ffdcb disable new failure injection 2022-08-08 14:39:21 -06:00
Markus Pilman 86ee76ec50
Merge pull request #7816 from sfc-gh-mdvorsky/mdvorsky/coverage
Flush gcov coverage upon SIGTERM
2022-08-08 12:03:22 -06:00
Markus Pilman c9865809e0
Merge pull request #7786 from sfc-gh-mdvorsky/mdvorsky/net2_unittest
Add Net2 unittests for ThreadSafeQueue and Net2::onMainThread
2022-08-08 11:23:31 -06:00
Marian Dvorsky e268ae9a86 Run clang-format 2022-08-08 18:48:15 +02:00
Marian Dvorsky b8370e5129 Print SIGNAL output to stdout 2022-08-08 18:28:11 +02:00
Marian Dvorsky 77269d0506 Print to stderr only upon errors 2022-08-08 18:11:35 +02:00
Vaidas Gasiunas 79571dd2b4
Testing upgrades to a future version of FDB (#7780)
* Enable configuring the next future protocol version as the current protocol version in FDB client, fdbserver, and fdbcli

* Auto format python files used in upgrade tests

* Add a test for upgrading to a future FDB version

* Emphasize that the options for using future protocol version are intended for test purposes only

* Make the global variable for current protocol version visible only locally

* Refactirng to avoid using currentProtocolVersion() in static intialization

* Update go bindings
2022-08-08 17:29:49 +02:00
Marian Dvorsky 722f66beb7 Flush gcov coverage upon SIGTERM 2022-08-08 17:11:20 +02:00
Xiaoxi Wang b18e29dd87 Merge remote-tracking branch 'upstream' into feature/main/ddvisibility 2022-08-06 21:43:36 -07:00
Xiaoxi Wang c199ea054c format code 2022-08-06 20:01:35 -07:00
Dan Lambright f9866f419a Propagate environment variables to spaned fdbserver process 2022-08-06 11:09:09 -07:00
Marian Dvorsky 671a2f9f8e Add comment to INetwork 2022-08-05 19:59:06 +02:00
Marian Dvorsky 6b790ef4b8 Disable the new onMainThread test in simulation 2022-08-05 17:06:34 +02:00
Marian Dvorsky 7c00c57253 Small fixes 2022-08-05 16:30:05 +02:00
sfc-gh-tclinkenbeard 7fe2088e09 Add ITagThrottler::getRates method 2022-08-04 16:58:58 -07:00
A.J. Beamon ff23d5994e
Merge pull request #7729 from sfc-gh-ajbeamon/feature-metacluster
Metacluster
2022-08-04 15:29:44 -07:00
Xiaoxi Wang 90b0d74875 DebugRelocationTraceEvent; TraceInterval randomId: 2022-08-04 15:28:33 -07:00
Fuheng Zhao d5c3679046 merge upstream main and resolve conflicts 2022-08-04 12:15:00 -07:00
Jingyu Zhou 84d483605b
Merge pull request #7431 from xis19/main
Let the storage server reports busiest write tag
2022-08-04 10:23:31 -07:00
Marian Dvorsky 9e4af40b0f Run clang-format 2022-08-04 16:20:42 +02:00
Marian Dvorsky 70748f51e4 Add Net2 unittests for ThreadSafeQueue and onMainThread 2022-08-04 16:03:59 +02:00
Xiaoxi Wang 07eafcec93
Merge pull request #7763 from sfc-gh-xwang/feature/main/unittest
move waitForMost into generic actors
2022-08-02 13:30:30 -07:00
Dan Lambright 4a25f8b692 Merge remote-tracking branch 'origin' into env 2022-08-02 14:51:50 -04:00
Dan Lambright 473feef246 Set knobs using environment variables 2022-08-02 14:29:37 -04:00
Xiaoxi Wang 3c76ad9e72 move waitForMost into generic actors 2022-08-02 10:38:11 -07:00
Josh Slocum 4b66645d80
Granule file performance benchmark and improvements (#7742)
* 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
Xiaoge Su 75b69d7774 fixup! gcc build error 2022-08-01 18:56:50 -07:00
Xiaoge Su ead1aa5bc1 fixup! Remove C++20 attribute 2022-08-01 18:56:50 -07:00
Xiaoge Su ec40c6bfec fixup! Add a wrapper of ResourceWeakRef for better support of self pointer 2022-08-01 18:56:50 -07:00
Xiaoge Su 2ce456bd3f fixup! Fix minor issues
* Reintroduce the anonymous namespace deleted by accident
 * Rename the guardian definition in OwningResource.h
2022-08-01 18:56:50 -07:00
Xiaoge Su bc9d2e8cbe fixup! Fix per upstream change 2022-08-01 18:56:50 -07:00
Xiaoge Su cf04afe925 fixup! Non-owning reference to an object
See documents in flow/OwningResource.h
2022-08-01 18:56:50 -07:00
Xiaoge Su 26877a8924 fixup! Remove the boost/bind.hpp in TLSTest.cpp
Not used, and causes gcc emit warning
2022-08-01 18:56:50 -07:00
A.J. Beamon 1b693a588a Merge branch 'main' into feature-metacluster 2022-08-01 14:43:14 -07:00
Renxuan Wang 51b92d59b9
Merge pull request #7733 from RenxuanW/hostname-backup
Prefer IPv6 in hostname resolving.
2022-08-01 12:34:02 -07:00
Renxuan Wang 4a0bea2230 Document for pickOneAddress(). 2022-08-01 10:54:04 -07:00
A.J. Beamon ad52c575a8 Merge branch 'main' into feature-metacluster 2022-07-30 18:33:19 -07:00
Xiaoxi Wang dd902fc772 create ShardsAffectedByTeamFailure.h 2022-07-29 15:12:15 -07:00
A.J. Beamon 8b7b6d1d4c Various cleanup; change some test parameters; add a test for metacluster management operations 2022-07-29 09:24:06 -07:00
Renxuan Wang 316ea60232 Prefer IPv6 in hostname resolving. 2022-07-28 20:07:16 -07:00
A.J. Beamon e8e4f3ad3a Merge branch 'main' into feature-metacluster
# Conflicts:
#	fdbclient/include/fdbclient/Tenant.h
2022-07-28 16:53:29 -07:00
A.J. Beamon 5db1135ac6 Add MetaclusterOperationContext to make it easier to run multi-transaction operations 2022-07-28 16:44:20 -07:00
A.J. Beamon 65cfc839a6 Some various cleanup 2022-07-28 13:35:24 -07:00
Markus Pilman ade9d20780
Merge pull request #7628 from sfc-gh-mpilman/features/code-coverage-test-harness
Change test harness to include comments
2022-07-28 13:54:21 -06:00
A.J. Beamon 7f53b340f5 Merge branch 'main' into feature-metacluster
# Conflicts:
#	bindings/python/tests/fdbcli_tests.py
#	fdbcli/TenantCommands.actor.cpp
#	fdbclient/ClientKnobs.cpp
#	fdbclient/include/fdbclient/ClientKnobs.h
#	fdbclient/include/fdbclient/Tenant.h
#	fdbserver/BlobManager.actor.cpp
#	fdbserver/BlobWorker.actor.cpp
#	fdbserver/TenantCache.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
#	flow/include/flow/error_definitions.h
2022-07-28 11:43:21 -07:00
Junhyun Shim 65b441bd1b Watch public key file at CLI-arg path
Argument name: authorization-public-key-file
2022-07-28 20:03:19 +02:00
Junhyun Shim 1dbb13a899 Accept non-mTLS clients as untrusted 2022-07-28 20:03:07 +02:00
Markus Pilman 5469e58562 Merge remote-tracking branch 'origin/main' into features/code-coverage-test-harness 2022-07-28 10:01:20 -06:00
Junhyun Shim 1e83d7e1ab Apply code review suggestions 2022-07-28 00:47:14 +02:00
Junhyun Shim c6342a6e5b
Merge branch 'main' into features/authz 2022-07-27 20:51:32 +02:00
Markus Pilman ef46f72d0c Merge remote-tracking branch 'origin/main' into features/code-coverage-test-harness 2022-07-27 10:41:18 -06:00
A.J. Beamon 7c6b3fb0b8 Merge branch 'main' into feature-metacluster 2022-07-27 08:55:10 -07:00
A.J. Beamon d39c0b773a Add a limit to the number of tenants that can be created in a cluster 2022-07-27 08:21:03 -07:00
A.J. Beamon dec6dbfbfb
Merge pull request #7549 from sfc-gh-ajbeamon/feature-tenant-groups
Add support for tenant groups
2022-07-27 07:56:27 -07:00
Junhyun Shim d5f7294bd2 Fix failing Mac/BoringSSL build 2022-07-27 01:05:56 +02:00
Junhyun Shim 5169616b16 Fix unresolved merge conflicts 2022-07-27 00:38:16 +02:00
Junhyun Shim e2a3fedfc7
Merge branch 'main' into features/authz 2022-07-27 00:08:57 +02:00
Josh Slocum 0609aa57d1 Merge branch 'main' into improved_cf_testing 2022-07-26 16:44:13 -05:00
Josh Slocum c32e1da908
Merge pull request #7673 from sfc-gh-jslocum/delta_files_v2
Sorted Delta Files
2022-07-26 16:04:55 -05:00
Xiaoxi Wang 7cf6037191 remove runAfter 2022-07-26 12:12:56 -07:00
Xiaoxi Wang 53d1e1abf3 create ShardsAffectedByTeamFailure files 2022-07-26 10:15:51 -07:00
A.J. Beamon a64693518a Add support for tenant groups 2022-07-26 09:04:29 -07:00
Renxuan Wang dc9599f2e9
Get network interfaces ready for https proxy. (#7556)
* Move HTTP from fdbclient/ to fdbrpc/.

* Move md5 and libb64 to contrib/.

* Get network interfaces ready for https proxy.

* Rebase
2022-07-25 17:08:32 -07:00
Fuheng Zhao f761f9a03a use DefaultEndPoint as the default priority for storage server reads 2022-07-25 10:10:42 -07:00
A.J. Beamon 077003c4f5 Cleanup tenant tombstones periodically 2022-07-24 18:24:19 -07:00
Junhyun Shim 742b73028c Fix incorrect range in randomSkewedUInt32()
Currently it invokes pow(10, uniform_rand(log_e(range_begin), log_e(range_end))),
which may overflow beyond UINT32_MAX.
Fix it by preventing log_e(0) case and change pow base to M_E
2022-07-24 23:02:48 +02:00
Andrew Noyes 83a317ef88
Disable guard pages for valgrind build. Closes #7610 (#7672) 2022-07-22 16:51:05 -07:00
A.J. Beamon 524c3131c5 Use a more specific error if we reject a tenant property change due to it needing to be moved 2022-07-22 15:43:51 -07:00
Josh Slocum ea9018460a cleanup and polish 2022-07-22 15:13:32 -05:00
A.J. Beamon 9b66e0c1c7 Fix some subtle differences between branches 2022-07-22 12:51:24 -07:00
A.J. Beamon b308aa6604 Merge branch 'feature-tenant-groups' into feature-metacluster 2022-07-22 11:38:23 -07:00
A.J. Beamon 237081905d Add support for tenant groups 2022-07-22 09:27:31 -07:00
A.J. Beamon 3e1763e7ac Merge branch 'main' into feature-metacluster 2022-07-21 14:48:53 -07:00
Xiaoxi Wang e1c4aa1bd5 Merge branch 'main' of https://github.com/apple/foundationdb into feature/dd-refactor-simple 2022-07-21 12:43:58 -07:00
Andrew Noyes 45c8a4e09d
Build fixes/improvements for sanitizers (#7657)
* Don't build fdb c shim with ubsan

This avoids duplicate symbols when linking. It doesn't really make sense
to assemble files with -fsanitize=undefined anyway, since it won't
insert instrumentation.

* Consolidate boost_asan with boost_target
2022-07-21 12:43:38 -07:00
Xiaoxi Wang 6eaf39c6cc change reference to pointer; default constructor enabled 2022-07-21 11:37:26 -07:00
Junhyun Shim 908b8faa88 Fix unmatched signatures for BoringSSL 2022-07-21 15:17:34 +02:00
Junhyun Shim 97880880cd Defer Simulation check in OSSL-IRandom binding until g_network is set 2022-07-21 14:52:02 +02:00
Junhyun Shim f76021fe7b Apply Clang format 2022-07-21 12:12:48 +02:00
Junhyun Shim e6fe4a62b4 Ensure DeterministicRandom gets used by OpenSSL exclusively in Simulation 2022-07-21 12:11:33 +02:00
A.J. Beamon 190711ccd8
Merge pull request #7622 from sfc-gh-ajbeamon/eat-and-connection-string-changes
Add some helper functions to ClusterConnectionString and an improvement to StringRef.eat
2022-07-20 16:10:24 -07:00
A.J. Beamon 4d036ae339
Merge pull request #7626 from sfc-gh-ajbeamon/tenant-metadata-change
Some changes to the tenant metadata
2022-07-20 14:50:00 -07:00
Ata E Husain Bohra 9a3e88df46
Fix ASAN build (#7629)
* Fix ASAN build

Description
  -diff-2: Fix Mac build issues
  -diff-1: Address review comments

Patch addresses the issue where ASAN build failed after introducing
BlobGranule compression.

Testing

ASAN build
2022-07-20 14:14:46 -07:00
A.J. Beamon 279296c29f Merge branch 'tenant-metadata-change' into feature-metacluster
# Conflicts:
#	fdbclient/SystemData.cpp
#	fdbclient/Tenant.cpp
#	fdbclient/include/fdbclient/SystemData.h
#	fdbclient/include/fdbclient/Tenant.h
#	fdbclient/include/fdbclient/TenantManagement.actor.h
#	fdbserver/TenantCache.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
2022-07-20 09:18:27 -07:00
Junhyun Shim b521dc2f58 Bind DeterministicRandom to OpenSSL RNG 2022-07-20 16:03:09 +02:00
Josh Slocum 5540f92e2e Refactoring randomExp to the proper place 2022-07-20 08:36:03 -05:00
Junhyun Shim 0874e553cd Place generateRandomData() under {I|Deterministic}Random 2022-07-20 13:21:11 +02:00
Markus Pilman 3327ab395b Change test harness to include comments 2022-07-19 15:41:53 -06:00
A.J. Beamon 537ceff8ac Remove the ability to configure a tenant subspace. Rename the prefixes used for tenant metadata. 2022-07-19 14:32:05 -07:00
Dan Adkins f144c929d3 Fix parsing of knob values to reject invalid values.
As of version 7.1, knob parsing started using std::stol which will
partially consume its input and return success, even if that's not
what we want, e.g. std::stol("4GiB") returns 4.

This changes returns the behavior of 7.0, which would consider the
above example invalid.
2022-07-19 16:46:42 -04:00
Markus Pilman 1de37afd52
Make TEST macros C++ only (#7558)
* proof of concept

* use code-probe instead of test

* code probe working on gcc

* code probe implemented

* renamed TestProbe to CodeProbe

* fixed refactoring typo

* support filtered output

* print probes at end of simulation

* fix missed probes print

* fix deduplication

* Fix refactoring issues

* revert bad refactor

* make sure file paths are relative

* fix more wrong refactor changes
2022-07-19 13:15:51 -07:00
A.J. Beamon 3ceb2a0639 Merge branch 'main' into feature-metacluster 2022-07-19 13:04:54 -07:00
A.J. Beamon 7324f28441 Add the ability for StringRef.eat to return whether a separator was found. Add a serialize function and equality operators to ClusterConnectionString. Remove unused variable. 2022-07-19 11:55:58 -07:00
Fuheng Zhao 2322730345 fix issues related to terminate storage server 2022-07-19 11:19:30 -07:00
Renxuan Wang 570db7a7d2
Fix processDiskReadSeconds and processDiskWriteSeconds. (#7608) 2022-07-18 13:47:45 -07:00
Renxuan Wang 78fecb76d9 Fix processDiskReadSeconds and processDiskWriteSeconds. 2022-07-18 11:25:12 -07:00
A.J. Beamon 8f77048e95 Add the ability to configure tenant groups in a metacluster 2022-07-18 11:24:49 -07:00
Junhyun Shim 8b70c7050d Apply RTLD_NODELETE for USE_SANITIZER builds
This allows their stack trace to be symbolized in CI/Jenkins XSAN runs
2022-07-18 19:25:12 +02:00
Andrew Noyes 989e323991
Attempt to fix windows build (#7600)
* Attempt to fix windows build

The windows build is complaining that some symbols in flow are
duplicate, which seems fair since we're currently compiling all the flow
sources and _also_ linking to flow for flowlinktest. This change makes
it so that we only link flow, and don't compile the flow source files
again.

* Remove source files from fdbclient and fdbrpc link tests
2022-07-18 08:59:03 -07:00
A.J. Beamon 860d3843cc Merge remote-tracking branch 'origin/feature-tenant-groups' into feature-metacluster 2022-07-16 19:33:26 -07:00
A.J. Beamon c08592368f Add support for tenant groups 2022-07-15 21:18:41 -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 24b2de8de8 BlobFile Encryption and compression support
Description

Testing
2022-07-14 17:04:14 -07:00
Fuheng Zhao 312e160a12 use PriorityMultiLock in storage server 2022-07-14 15:29:54 -07:00
A.J. Beamon cb499fa5db Merge branch 'main' into feature-metacluster 2022-07-13 15:28:34 -07:00
Fuheng Zhao 0612f0f1b2 Merge branch 'main' of https://github.com/apple/foundationdb into RedwoodIOLaunchLimit 2022-07-12 10:17:41 -07:00
Markus Pilman 2edbcf2c65
Merge pull request #44 from apple/main
Merge main
2022-07-12 07:51:22 -06:00
Markus Pilman fa9e623fc1
Merge pull request #7459 from sfc-gh-ljoswiak/features/module-link-tests
Add test executables to catch missing symbols in modules
2022-07-11 17:31:11 -06:00
Fuheng Zhao 358b592458 Merge branch 'main' of https://github.com/apple/foundationdb into RedwoodIOLaunchLimit 2022-07-11 15:19:35 -07:00
Fuheng Zhao 0955419418 move ParsingStringVector function to genericactor class 2022-07-11 11:13:32 -07:00
Junhyun Shim 61f3d14ec6 Add TokenCache test
Add function authz::jwt::TokenRef::toStringRef() for token tracing
Add StringRef::toStringView()
2022-07-11 13:42:41 +02:00
He Liu bc5bfaffda
Shard based move (#6981)
* Shard based move.

* Clean up.

* Clear results on retry in getInitialDataDistribution.

* Remove assertion on SHARD_ENCODE_LOCATION_METADATA for compatibility.

* Resolved comments.

Co-authored-by: He Liu <heliu@apple.com>
2022-07-07 20:49:16 -07:00
A.J. Beamon 346d3c3265
Merge pull request #7487 from sfc-gh-ajbeamon/buggified-commit-helper
Add a helper to simulate a commit that can fail with unknown result or take a long time
2022-07-07 16:17:19 -07:00
Markus Pilman 56541167c2 send token with tenant info object 2022-07-06 20:58:17 -06:00
A.J. Beamon c9b553663e Merge branch 'main' into feature-metacluster
# Conflicts:
#	bindings/java/src/main/com/apple/foundationdb/TenantManagement.java
#	fdbcli/TenantCommands.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbclient/TenantSpecialKeys.actor.cpp
#	fdbclient/include/fdbclient/KeyBackedTypes.h
#	fdbclient/include/fdbclient/RunTransaction.actor.h
#	fdbclient/include/fdbclient/SpecialKeySpace.actor.h
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
2022-07-06 15:44:21 -07:00
Lukas Joswiak 618f8455c4 Add test executables to catch missing symbols
Currently, we have code in different folders like `flow/` and `fdbrpc/`
that should remain isolated. For example, `flow/` files should not
include functionality from any other modules. `fdbrpc/` files should
only be able to include functionality from itself and from `flow/`.
However, when creating a shared library, the linker doesn't complain
about undefined symbols -- this only happens when creating an
executable. Thus, for example, it is possible to forward declare an
`fdbclient` function in an `fdbrpc` file and then use it, and nothing
will break (when it should, because this is illegal).

This change adds dummy executables for a few modules (`flow`, `fdbrpc`,
`fdbclient`) that will cause a linker error if there are included
symbols which the linker can't resolve.
2022-07-06 14:49:33 -07:00
A.J. Beamon 8897a03913 Allow for random delays in buggifiedCommit that don't cause timeouts or that occur before we throw commit_unknown_result. Add a delay(0) to avoid a nowait buggifiedCommit in the typical case. 2022-07-06 12:48:13 -07:00
Junhyun Shim db449b80f7
Authz JWKS (#7519)
* Add JsonWebKeySet parser/stringifier

* Update header directory

* Make JWKS parser correctness clean for OpenSSL 1.x

Add RSA keygen support

* Make JWKS parser correctness clean for OpenSSL 3.x

+extend unique_ptr for scoped destruction of OpenSSL objects

* Use PKey::{sign|verify}() in TokenSign

* Apply AutoCPointer to MkCert

* Apply Clang format

* JWKS::toStringRef() returns StringRef > Optional<StringRef>

* Fix Mac/Windows build error

* Fix incorrect fix of Mac build

* Fix filename in license comment for AutoCPointer.h

* Refactor complex C macros into function templates
2022-07-05 10:13:09 +02:00
A.J. Beamon aea4d802c6 Merge branch 'main' into feature-metacluster 2022-06-30 15:08:09 -07:00
Yi Wu 364644673f
Support TLog encryption in commit proxy (#6942)
This PR add support for TLog encryption through commit proxy. The encryption is done on per-mutation basis. As CP writes mutations to TLog, it inserts encryption header alongside encrypted mutations. Storage server (and other consumers of TLog such as storage cache and backup worker) decrypts the mutations as they peek TLog.
2022-06-29 14:21:05 -07:00
sfc-gh-tclinkenbeard 2134fa9a0c Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-28 19:51:41 -07:00
A.J. Beamon 55404d0cd8 Add a helper to simulate a commit that can fail with unknown result or take a long time 2022-06-28 16:41:57 -07:00
A.J. Beamon e1a93988ef Merge branch 'main' into feature-metacluster 2022-06-28 14:58:07 -07:00
Markus Pilman 9d16260822 Merge remote-tracking branch 'origin/main' into features/authz 2022-06-28 13:13:51 -06:00
sfc-gh-tclinkenbeard 086e4bff06 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-28 10:18:13 -07:00
Markus Pilman 20e7371036 some Linux fixes 2022-06-28 08:51:13 -06:00
Markus Pilman d31fb30f57 fdbclient compiling 2022-06-27 18:31:05 -06:00
Markus Pilman 88af6b403f fdbrpc compiling 2022-06-27 18:11:55 -06:00
Markus Pilman 03d913a1de Flow compiling 2022-06-27 17:05:55 -06:00
A.J. Beamon eccf244ba6 Add an index that allows us to allocate tenants from the non-full cluster with the most tenants already assigned to it. 2022-06-27 12:28:55 -07:00
Markus Pilman 3aaae9c521 Merge remote-tracking branch 'origin/main' into features/authz 2022-06-27 11:07:14 -06:00
Markus Pilman e35633149c
Merge pull request #7447 from sfc-gh-mpilman/bugfixes/cmake-disallow-illegal-cross-module-includes
enforce include modularization in cmake
2022-06-24 22:42:18 -06:00
Markus Pilman a47ed89018 Linux fixes and addressed review comments 2022-06-23 20:52:13 -06:00
Markus Pilman de48e90276 fdbserver is now compiling 2022-06-23 18:45:26 -06:00
Markus Pilman 8af056e7b0 fdbclient now compiling 2022-06-23 18:05:36 -06:00
A.J. Beamon 9260367cac Remove a few things and some other small cleanup. 2022-06-23 15:39:53 -07:00
Markus Pilman 10e478dfc3 Flow is compiling 2022-06-23 16:35:19 -06:00
Markus Pilman d35445a868 enforce include modularization in cmake 2022-06-23 14:37:35 -06:00
sfc-gh-tclinkenbeard 840dac1fa3 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-22 22:17:33 -07:00
A.J. Beamon 485df52b0f Add check to avoid using memcpy with an invalid data pointer 2022-06-22 15:57:47 -07:00
Lukas Joswiak 88557d9169 Simplify function call when transaction is null 2022-06-22 14:50:17 -07:00
Lukas Joswiak 4c2bb0b44e Fix undefined behavior from accessing field of uninitialized object 2022-06-22 14:50:17 -07:00
A.J. Beamon 9f3819752f Change the command to create a metacluster from using 'configure tenant_mode=management' to 'metacluster create <NAME>'. Distribute this name to all processes in a metacluster. Eliminate the tenant mode entirely from metacluster clusters, instead relying on a metacluster registration key. 2022-06-22 12:15:43 -07:00
sfc-gh-tclinkenbeard 2391e58fb2 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-21 10:09:15 -07:00
Andrew Noyes 83aceb216c
Use absl::GetStackTrace for slow task profiler (#7374)
* Make SlowTask workload runnable in joshua

* Remove SignalSafeUnwind, and use absl::GetStackTrace for slow task profiler
2022-06-15 14:53:52 -07:00
Andrew Noyes 0fea3fb731
Save a bunch of copies in the trace thread (#7392)
Currently, a std::string is copied unnecessarily for every key and value
in a trace event.

This actually showed up in a jemalloc heap profile while I was
investigating something unrelated. I was surprised to see it since these
allocations should have a very short lifetime.
2022-06-15 12:29:15 -07:00
Ata E Husain Bohra 8808d93813
Fix bugs in EncyrptKeyProxy actor (#7388)
Description

Major changes include:
1. GetEncryptByKeyIds cache elements can expire.
2. Update iterator after erasing an element during refresh encryption keys
   operation.

Testing

EncryptKeyProxyTest
2022-06-14 21:22:25 -07:00
Junhyun Shim ed91ab5d54
Work around flow trace's data race bug (#7237)
* Work around flow trace's data race bug

BaseTraceEvent::setNetworkThread() and flushTraceFile[()|Void()]
has a long-standing race condition for traceEventThrottlerCache global
when flushTraceFileVoid() is not called from the network thread.

This race dates back to 2017 (commit hash 80e5fecfe2),
so before the race itself is fixed, work around the problem.

* Remove call to flushTraceFileVoid() from MkCertCli

* Apply clang format
2022-06-14 12:09:34 +02:00
Renxuan Wang 839af5701e
Fix bug in resolveTCPEndpoint() when hostname resolving fails. (#7375)
* Close trace file when error happens in runNetwork().

* Improve the bestCount algorithm in getLeader().

In the current implementation, if the nominees are [0,1], the chosen leader will be 1, which is an exception to other cases and our expectation that if 2 nominees have the same frequency, the one with lower id will be the leader.

* Remove unnecessary new statement.

stream will never be a nullptr.

* Move self->dnsCache out of lambda capture.

Member variables are not capture by default, thus, `host` and `service` are not captured. This somehow successfully compile, but throws std::bad_alloc or basic_string::_S_create exceptions when we call `host+":"+service` in dnsCache.remove().

* Revert unintended change.

* Address comments.
2022-06-13 20:24:30 -07:00
Markus Pilman 799fe32346 Merge remote-tracking branch 'origin/main' into features/authz 2022-06-13 18:02:11 -06:00
Trevor Clinkenbeard 6bed046148
Merge pull request #7352 from sfc-gh-xwang/feature/ddtxn
[DD testability enhancement] Create IDDTxnProcessor and simple refactoring
2022-06-13 16:01:13 -07:00
Xiaoge Su 5a2804e04b
fixup! Fix the XmlTraceLogFormatter (#7322)
* fixup! Fix the XmlTraceLogFormatter

The original escape process uses a `loop` while the code is actually not
an ACTOR. So the actorcompiler is not reacting. This causes the escape
not escaping the XML fields properly.

* fixup! Reformat source
2022-06-13 13:38:17 -07:00
Xiaoxi Wang ea2edebbeb comment out store tuple 2022-06-13 13:36:19 -07:00
Ata E Husain Bohra a5d91fe18a
KmsConnector implementation to support KMS driven CipherKey TTL (#7334)
* KmsConnector implementation to support KMS driven CipherKey TTL

Description

KMS CipherKeys can be of two types:
1. Revocable CipherKeys: having a finite lifetime, after which the CipherKey
shouldn't be used by the FDB.
2. Non-revocable CipherKeys: ciphers are not revocable, however, FDB would
still want to refresh ciphers to support KMS cipher rotation feature.

Patch proposes following change to incorporate support for above defined cipher-key
types:
1. Extend KmsConnector response to include optional 'refreshAfter' & 'expireAfter'
time intervals. EncryptKeyProxy (EKP) cache would define corresponding absolute refresh &
expiry timestamp for a given cipherKey. On an event of transient KMS connectivity outage,
a caller of EKP API for a non-revocable key should continue using cached cipherKey until
it expires.
2. Simplify KmsConnector API arena handling by using VectorRef to represent component
structs and manage associated memory allocation/lifetime.

Testing

1. EncryptKeyProxyTest
2. RESTKmsConnectorTest
3. SimKmsConnectorTest

* KmsConnector implementation to support KMS driven CipherKey TTL

Description

  diff-1: Set expireTS for baseCipherId indexed cache

KMS CipherKeys can be of two types:
1. Revocable CipherKeys: having a finite lifetime, after which the CipherKey
shouldn't be used by the FDB.
2. Non-revocable CipherKeys: ciphers are not revocable, however, FDB would
still want to refresh ciphers to support KMS cipher rotation feature.

Patch proposes following change to incorporate support for above defined cipher-key
types:
1. Extend KmsConnector response to include optional 'refreshAfter' & 'expireAfter'
time intervals. EncryptKeyProxy (EKP) cache would define corresponding absolute refresh &
expiry timestamp for a given cipherKey. On an event of transient KMS connectivity outage,
a caller of EKP API for a non-revocable key should continue using cached cipherKey until
it expires.
2. Simplify KmsConnector API arena handling by using VectorRef to represent component
structs and manage associated memory allocation/lifetime.

Testing

1. EncryptKeyProxyTest
2. RESTKmsConnectorTest
3. SimKmsConnectorTest

* KmsConnector implementation to support KMS driven CipherKey TTL

Description

  diff-2: Fix Valgrind issues discovered runnign tests
  diff-1: Set expireTS for baseCipherId indexed cache

KMS CipherKeys can be of two types:
1. Revocable CipherKeys: having a finite lifetime, after which the CipherKey
shouldn't be used by the FDB.
2. Non-revocable CipherKeys: ciphers are not revocable, however, FDB would
still want to refresh ciphers to support KMS cipher rotation feature.

Patch proposes following change to incorporate support for above defined cipher-key
types:
1. Extend KmsConnector response to include optional 'refreshAfter' & 'expireAfter'
time intervals. EncryptKeyProxy (EKP) cache would define corresponding absolute refresh &
expiry timestamp for a given cipherKey. On an event of transient KMS connectivity outage,
a caller of EKP API for a non-revocable key should continue using cached cipherKey until
it expires.
2. Simplify KmsConnector API arena handling by using VectorRef to represent component
structs and manage associated memory allocation/lifetime.

Testing

1. EncryptKeyProxyTest
2. RESTKmsConnectorTest
3. SimKmsConnectorTest

* KmsConnector implementation to support KMS driven CipherKey TTL

Description

  diff-3: Address review comment
  diff-2: Fix Valgrind issues discovered runnign tests
  diff-1: Set expireTS for baseCipherId indexed cache

KMS CipherKeys can be of two types:
1. Revocable CipherKeys: having a finite lifetime, after which the CipherKey
shouldn't be used by the FDB.
2. Non-revocable CipherKeys: ciphers are not revocable, however, FDB would
still want to refresh ciphers to support KMS cipher rotation feature.

Patch proposes following change to incorporate support for above defined cipher-key
types:
1. Extend KmsConnector response to include optional 'refreshAfter' & 'expireAfter'
time intervals. EncryptKeyProxy (EKP) cache would define corresponding absolute refresh &
expiry timestamp for a given cipherKey. On an event of transient KMS connectivity outage,
a caller of EKP API for a non-revocable key should continue using cached cipherKey until
it expires.
2. Simplify KmsConnector API arena handling by using VectorRef to represent component
structs and manage associated memory allocation/lifetime.

Testing

1. EncryptKeyProxyTest
2. RESTKmsConnectorTest
3. SimKmsConnectorTest
2022-06-13 13:25:01 -07:00
Andrew Noyes 38db712e7a
Make ASAN arena aware (#7336) 2022-06-13 13:24:02 -07:00
sfc-gh-tclinkenbeard df71a49bf6 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-06-13 10:03:10 -07:00
Ray Jenkins c45abc7c32
Add TRACING_SPAN_ATTRIBUTES_ENABLED Knob, default false. (#7354)
* Add TRACING_SPAN_ATTRIBUTES_ENABLED Knob, default false.

In order to prevent accidental leakage of PII to external tracing collector services,
we've added a knob to prevent additional attributes to be added to spans unless explicitly
enabled by the user.

* Enable span attributes knob for unit tests.
2022-06-13 11:37:09 -05:00
Steve Atherton 90bb3a7f8c
Merge pull request #7341 from sfc-gh-satherton/net2-react-perf-fix
Performance bug fix: reactor.react() is called too often.
2022-06-09 17:55:07 -07:00
Xiaoxi Wang 7ee6808ebd solve compiler warning 2022-06-09 14:32:24 -07:00
A.J. Beamon 739fc9ce6b Merge branch 'main' into feature-metacluster 2022-06-09 12:39:34 -07:00
Xiaoxi Wang e5aa5fef22 merge upstream/main 2022-06-09 12:17:27 -07:00
Xiaoxi Wang 6ab12ea971 add storeTuple and unit test; refactor getSourceServersForRange 2022-06-09 12:16:12 -07:00
Robert Barabas 8606923da2
Arm64 related build fixes (#7319)
* Add missing include

* Fix open call on arm64

* Bump up doctest to 2.4.8
2022-06-08 11:20:27 -07:00
Markus Pilman d141347500
Merge pull request #7282 from Doxense/fix-windows-tests
Fix windows tests
2022-06-08 08:18:47 -06:00
Yi Wu bbf8cb4b02
GetEncryptCipherKeys helper function and misc encryption changes (#7252)
Adding GetEncryptCipherKeys and GetLatestCipherKeys helper actors, which encapsulate cipher key fetch logic: getting cipher keys from local BlobCipherKeyCache, and on cache miss fetch from EKP (encrypt key proxy). These helper actors also handles the case if EKP get shutdown in the middle, they listen on ServerDBInfo to wait for new EKP start and send new request there instead.

The PR also have other misc changes:
* EKP is by default started in simulation regardless of. ENABLE_ENCRYPTION knob, so that in restart tests, if ENABLE_ENCRYPTION is switch from on to off after restart, encrypted data will still be able to be read.
* API tweaks for BlobCipher
* Adding a ENABLE_TLOG_ENCRYPTION knob which will be used in later PRs. The knob should normally be consistent with ENABLE_ENCRYPTION knob, but could be used to disable TLog encryption alone.

This PR is split out from #6942.
2022-06-07 21:00:13 -07:00
Steve Atherton 697aa6cc32 Performance bug fix: reactor.react() is called too often. 2022-06-07 17:53:40 -07:00
A.J. Beamon ce1bd5f974 Merge branch 'multiple-tenant-creation' into feature-metacluster
# Conflicts:
#	fdbclient/GenericManagementAPI.actor.h
#	fdbclient/SpecialKeySpace.actor.cpp
#	fdbserver/tester.actor.cpp
#	fdbserver/workloads/FuzzApiCorrectness.actor.cpp
#	fdbserver/workloads/TenantManagement.actor.cpp
2022-06-06 15:04:10 -07:00
Hao Fu e7fa8e9f6f
Add versionstamp support in tuple (#7293)
Tuple in C++ needs to support Versionstamp.
2022-06-02 17:44:10 -07:00
A.J. Beamon 2907aafa60 Merge branch 'main' into feature-metacluster 2022-06-02 12:18:42 -07:00
Ata E Husain Bohra b66509eff0
Make EncryptKeyServer and KmsConnector API to be 'tenant' name aware (#7215)
Description

Major changes proposed include:
1. Update EncryptKeyServer APIs to be tenant aware.
2. Update KmsConnector APIs to be tenant aware

Client of above APIs such as: CP, SS and BlobWorker need to supply
encryption domain info that includes: tenantId and tenantName

Testing

1. Update EncryptKeyProxyTest
2. Update RESTKmsConnectorTest
3. Update SimKmsConnectorTest
2022-06-02 11:55:50 -07:00
Junhyun Shim 3e79735b2f
Authz JWT support (#7279)
* Add JWT support to TokenSign

* Encapsulate OpenSSL public/private key type

Type-safe passing around of keys without having to DER/PEM-serialize
(OpenSSL doesn't have distinct types for public and private key)

* Apply Clang format

* Add verify benchmark for JWT and FlatBuffers token

* Unit test base64url::{encode, decode}

* Make all payload fields optional

Let user code validate non-signature fields

* Make all payload fields optional

Completely defer field check to user code

* Move rapidjson from fdbclient to contrib

* Make fdbrpc's rapidjson linkage private

Currently only sources include them.

* Modify rapidjson path in apiversioner.py

* Algorithm::Unknown > Algorithm::UNKNOWN
2022-06-02 13:22:50 +02:00
A.J. Beamon 38b90910d6 Start some work toward simulating a metacluster. Fix a few bugs found by the initial tests. 2022-06-01 15:56:59 -07:00
sfc-gh-tclinkenbeard 29ebcdbfa9 Merge remote-tracking branch 'origin/main' into global-tag-throttling3 2022-05-31 14:53:51 -07:00
Mohamed Oulmahdi 26ad8bc184 Format 2022-05-31 14:17:41 +02:00
Vaidas Gasiunas 4d6ec7663f Close file at the end of runNetwork rather than in stopNetwork in order to avoid a race condition,
also in order to continue tracing the pending network thread activity.
Poll event throttler only in the network thread in order to avoid a race condition.
2022-05-31 13:59:09 +02:00
Mohamed Oulmahdi 81e81c6799 Fix atomicPath and abspath for Windows 2022-05-31 12:01:39 +02:00
Mohamed Oulmahdi 541ff206f3 Use \n instead of \r\n in log formatters 2022-05-31 11:59:21 +02:00
Xiaoxi Wang 5bea02cfde
Merge pull request #6686 from sfc-gh-xwang/readaware
Read-aware Data Distributor (default disabled)
2022-05-26 11:05:03 -07:00
Renxuan Wang cd2a575e02
Move the resolve of coordinator hostname from getCoordinatorProtocol() to getClusterProtocolImpl(). (#7245)
* Move the resolve of coordinator hostname from getCoordinatorProtocol() to getClusterProtocolImpl().

* Guard DNS Cache behind a knob.
2022-05-26 09:45:54 -07:00
Xiaoxi Wang 5816890dfc Merge branch 'main' of https://github.com/apple/foundationdb into readaware 2022-05-25 14:48:28 -07:00
A.J. Beamon 9773261a03 Expand support for tenant groups. Track where each tenant group is assigned and used groups to help assign tenants. Fix tenant state tracking bugs. Add help hints for metacluster remove FORCE. 2022-05-24 11:58:40 -07:00
Xiaoxi Wang 4cbec5c742
Merge branch 'apple:main' into features/debug-macro 2022-05-24 09:12:39 -07:00
Xiaoxi Wang fd35fde481 Merge branch 'main' of https://github.com/apple/foundationdb into readaware 2022-05-23 15:09:03 -07:00
Xiaoxi Wang bda65b95ad update header 2022-05-23 14:50:45 -07:00
Renxuan Wang df4e0deb4d
coordinatorsKey should not always store IP addresses. (#7204)
* coordinatorsKey should not storing IP addresses.

Currently, when we do a commit of coordinator change, we are always converting hostnames to IP addresses and store the converted results in coordinatorsKey (\xff/coordinators). This result in ForwardRequest also sending IP addresses, and receivers will update their cluster files with IPs, then we lose the dynamic IP feature.

* Remove the legacy coordinators() function.

* Update async_resolve().

ip::basic_resolver::async_resolve(const query & q, ResolveHandler && handler) is deprecated.

* Clean code format.

* Fix typo.

* Remove SpecifiedQuorumChange and NoQuorumChange.
2022-05-23 11:42:56 -07:00
Xiaoxi Wang 73624bcd2a Merge remote-tracking branch 'upstream/main' into readaware 2022-05-23 11:17:38 -07:00
Junhyun Shim 02b2f97e99
mTLS test helpers (#7218)
* Add TLS option to (local_cluster|tmp_cluster).py

* Add TLS-enabled C API test
2022-05-23 12:47:51 +02:00
A.J. Beamon d784173f7f Add first implementation of tenant creation and deletion in a metacluster 2022-05-20 15:21:21 -07:00
Xiaoxi Wang 5a431980d2 Merge branch 'main' of https://github.com/apple/foundationdb into features/debug-macro 2022-05-20 12:18:20 -07:00
Xiaoxi Wang 6b996dca29 add debug macro 2022-05-20 12:17:45 -07:00
Ray Jenkins d1efc05a9b
Remove parentContext.traceID from MessagePack serialization. (#7197)
The OTEL receiver does not utilize the parent Trace id, only parent Span id. Essentially
it relies on Trace ids implicitly matching during trace assembly. Therefore, we may remove
these 16 bytes in serialization.
2022-05-19 16:43:06 -05:00
He Liu bc509d9572 Added fetchCheckpointKeyValuesQ in storage server. 2022-05-19 13:27:21 -07:00
A.J. Beamon 69261f9f10 Merge branch 'main' into feature-metacluster
# Conflicts:
#	fdbclient/MultiVersionTransaction.actor.cpp
#	fdbclient/MultiVersionTransaction.h
#	fdbserver/tester.actor.cpp
2022-05-19 09:11:30 -07:00
Xiaoxi Wang 6c11fc74ba add debug traces 2022-05-18 15:20:23 -07:00
Xiaoxi Wang 382f0fc4a2 merge upstream/main 2022-05-17 10:20:51 -07:00
Xiaoxi Wang 3b241955e7 add more informative trace info 2022-05-16 21:25:56 -07:00
Xiaoxi Wang 8e2a78bf3c
Merge pull request #7087 from sfc-gh-xwang/features/read-skew
Add SkewedReadWriteWorkload
2022-05-16 16:13:57 -07:00
Junhyun Shim 3fe23ce666 Merge remote-tracking branch 'origin/main' into mtls-test-helpers 2022-05-16 13:19:45 +02:00
Junhyun Shim 5308a2727f Fix failing Mac build from boringssl
X509V3_EXT_conf_nid is part of 'libdecrepit' in BoringSSL.
Use X509V3_EXT_nconf_nid instead.
2022-05-16 11:58:42 +02:00
Xiaoxi Wang b0c26e93b2 remove size() method 2022-05-13 12:55:19 -07:00
Xiaoxi Wang e59bdbf3a3 merge upstream/main 2022-05-13 12:22:09 -07:00
Xiaoxi Wang 78f819fb2a
Update flow/serialize.h
Co-authored-by: Trevor Clinkenbeard <trevor.clinkenbeard@snowflake.com>
2022-05-13 11:36:03 -07:00
Vaidas Gasiunas 85092ab53c
Merge pull request #7148 from sfc-gh-jshim/mtls-test-helpers
Unit test MkCert
2022-05-13 15:39:46 +02:00
Andrew Noyes a92ef37d44 Log a backtrace before throwing serialization_failed 2022-05-12 20:08:36 -07:00
Junhyun Shim cd4a7038fc Move CertKind::getCommonName() to source file 2022-05-12 23:14:52 +02:00
Junhyun Shim 809bc52bbc Add boringssl workaround for Mac builds 2022-05-12 23:12:51 +02:00
Junhyun Shim 8117aa9670 Add Selective mTLS unit test using MkCert 2022-05-12 21:29:20 +02:00
Renxuan Wang 30e124c09b Remove HostnameStatus and resolve trigger.
They are no longer needed since we have coordinators DNS cache; and they are introducing complex crashes.
2022-05-12 10:13:55 -07:00
Junhyun Shim 0dbbadfd77
Merge pull request #7088 from sfc-gh-jshim/mtls-test-helpers
mTLS test helpers
2022-05-12 14:35:23 +02:00
A.J. Beamon 85019612d4 Remove subordinate mode and instead use a key in the system key-space to track metacluster membership. Use this key to determine if a cluster is already part of a metacluster or can be configured away from required mode. Disallow configuring to or from a management cluster that has data. 2022-05-11 17:10:55 -07:00
Ata E Husain Bohra a7cd61c5cf
Enable debugId tracing for encryption requests (#7111)
* Enable debugId tracing for encryption requests

Description

   diff-1: Minor fixes, address review comment

Proposed changes include:
1. Update EncryptKeyProxy API to embded Optional<UID> for debugging
   request execution.
2. Encryption participant FDB processes can set 'debugId' enabling
   tracing requests within FDB cluster processes and beyond.
3. The 'debugId' if available is embedded as part of 'request_json_payload'
   by RESTKmsConnector, enabling tracing request between FDB <--> KMS.
4. Fix EncryptKeyProxyTest which got broken due to recent changes.

Testing

Updated following test:
1. EncryptKeyProxy simulation test.
2. RESTKmsConnector simulation test.

Description

Testing
2022-05-11 13:23:27 -07:00
Junhyun Shim 88d1692de7 Fix BoringSSL-specific issues with Mac Build 2022-05-11 18:38:02 +02:00
Junhyun Shim fe55605a25 Fix GCC-specific error 2022-05-11 16:52:00 +02:00
Junhyun Shim 2e8654e048 Fix syntax error 2022-05-11 16:30:20 +02:00
Junhyun Shim 9155fbd1b8 Fix formatting and remove redundant trace field 2022-05-11 16:12:45 +02:00
Junhyun Shim 8818aedfbb Remove TLS Test 2022-05-11 16:01:22 +02:00
Junhyun Shim 6459e840dc Merge remote-tracking branch 'remotes/origin/main' into mtls-test-helpers 2022-05-11 16:00:17 +02:00
Junhyun Shim 8c180e3e46 Add option to print cert chain or arguments
Also do code cleanup
2022-05-11 15:56:17 +02:00
Junhyun Shim d3b966fcfd Refine trace and console message 2022-05-11 13:56:44 +02:00
Junhyun Shim 8789232df4 Add ScopeExit to flow and remove scattered impls 2022-05-11 11:51:11 +02:00
Junhyun Shim e5de8ba260 Add MkCert command line tool 2022-05-11 11:15:03 +02:00
Junhyun Shim ee9a047cbd Trace OpenSSL error as const char*
Remove extent from char buffer for fetching OpenSSL errors.
TraceEvent::detail() interprets passed char[] as string literal
and prints trailing \0s.
2022-05-10 19:54:12 +02:00
Junhyun Shim e4d204daf0 Rephrase function description 2022-05-10 17:00:57 +02:00
Vishesh Yadav 9173e2e19b Move GlobalConfig to DatabaseContext 2022-05-09 14:54:51 -07:00
A.J. Beamon 80a3c8dd50 All metacluster operations to the management cluster go through the management cluster special key space 2022-05-09 14:50:07 -07:00
Xiaoxi Wang 389e289fe4 merge upstream/main 2022-05-09 12:10:53 -07:00
Junhyun Shim 0339802014 Remove debug messages 2022-05-09 14:38:57 +02:00
Junhyun Shim 637044fd54 Add testcase for when client chain is invalid
Optionally allow the leaf certificates to have already expired
2022-05-09 14:01:39 +02:00
sfc-gh-tclinkenbeard 8553c28d74 Add invalid_throttle_quota_value error 2022-05-07 15:58:37 -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
Xiaoxi Wang 5bb70dda91 add remainedBytes method 2022-05-06 10:39:45 -07:00
Junhyun Shim e5f039acf8 Apply clang format 2022-05-06 19:10:42 +02:00
Junhyun Shim b6a200bd2c Set up a unit test to find the right setup for selective mTLS
To be modified or removed once implementation is complete
2022-05-06 19:10:02 +02:00
A.J. Beamon 7c3b99f5bd Add support for connection to clusters via a connection string. Start work on multi-cluster operations with data cluster registration. 2022-05-06 09:53:53 -07:00
Junhyun Shim 767a37f7d2 Helper functions to generate certs and keys for TLS testing 2022-05-06 12:56:35 +02:00