5686 Commits

Author SHA1 Message Date
sfc-gh-tclinkenbeard
7a2554c73e Remove code probe for \"Coordinator hostname resolving failure\"
This is not intended to be hit in simulation, and we have visibility
into these events with the MonitorProxiesConnectFailed trace event.
2022-09-12 10:09:08 -07:00
Vaidas Gasiunas
81fff640bd
Testing with invalid cluster files, fixing update from changed cluster file (#8126)
* ApiTester: test with invalid cluster files

* More asserts in monitorProxies

* ApiTester: Test tampering the cluster file

* Fix update of connection string from the cluster file to use the new connection string only if it valid

* ApiTester: add linker dependency on std++fs

* upgrade_test: no-cleanup-on-error option

* ApiTester: use atomic operations to change and access the transaction handle
2022-09-10 09:23:00 +02:00
Yi Wu
d831c87d14
Add encryption metrics (#8070)
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
Russell Sears
6546e3c458
Merge pull request #8138 from sears/header_macro_cleanup
Fix duplicate (and broken) header macro FDBCLIENT_EVENTTYPES[S]_ACTOR…
2022-09-09 16:31:16 -07:00
Jon Fu
e205147104
Merge pull request #7993 from sfc-gh-jfu/jfu-tenant-special-key-space
Explicit tenant support in special key space
2022-09-09 13:33:43 -07:00
Russell Sears
73f65c3192 Fix duplicate (and broken) header macro FDBCLIENT_EVENTTYPES[S]_ACTOR[_G]_H 2022-09-09 19:14:30 +00:00
Jon Fu
006fc9a0ef code formatting 2022-09-09 11:58:36 -07:00
Dennis Zhou
802893d02b FutureBool: fix bool -> fdb_bool_t
Honestly, this might not be an issue, but it's nice to be consistent
with the conversions across c++ -> c for bool type.
2022-09-09 11:29:52 -07:00
Dennis Zhou
28ac29476a blob: fix unblobbify calling blobbify 2022-09-09 11:29:52 -07:00
Jon Fu
75a096a5e5 Merge branch 'main' of github.com:apple/foundationdb into jfu-tenant-special-key-space 2022-09-09 10:12:19 -07:00
Josh Slocum
e66015cbe4
Including change feed bytes towards storage queue (#8107) 2022-09-08 16:37:44 -07:00
Andrew Noyes
bbc30c6a80
Assert that Arena's appear last in serializer calls (#8078)
* Assert that arena's appear last in serializer calls

* Fix all occurrences of Arena's not appearing last in serializer call

* Work around issue from Standalone inheriting from Arena privately

* Attempt to fix windows build

Use fb_ prefix instead of detail namespace to scope implementation
details in headers
2022-09-08 08:31:14 -07:00
A.J. Beamon
726d5215a0
Remove API 720 guards for tenants (experimental feature) and the cluster ID special keys (#8108)
* Remove API 720 guards for tenants (experimental feature) and the cluster ID special keys (no need to guard)

* Enable the relaxed special key access in transactions that need to use special key-space APIs introduced in 7.2
2022-09-08 17:22:36 +02:00
Vaidas Gasiunas
b6fb1034a9
Fix crashes on database create errors (#8115)
* ApiTester: enable access to database instances in workloads

* ApiTester: Inject database create errors

* Fix getClusterProtocol and database shared object initialization in case of database create errors

* Check deferred error in all Thread-Safe API calls returning a future

* ApiTester: disable injection of database create errors for tests with old versions
2022-09-08 09:21:51 +02:00
Xiaoxi Wang
e836b743c0 Merge branch 'main' of https://github.com/apple/foundationdb into fix/main/grvError 2022-09-07 20:50:03 -07:00
Dennis Zhou
7fc4a92d09
Merge pull request #8089 from sfc-gh-jslocum/unblobbify_idempotent
Blob range idempotency test and fixes
2022-09-07 17:31:05 -07:00
Jon Fu
da7ce5231c Merge branch 'main' of github.com:apple/foundationdb into jfu-tenant-special-key-space 2022-09-07 13:30:08 -07:00
Jon Fu
255795eac0 update test workload and reserve space for vector copies 2022-09-07 13:25:38 -07:00
Xiaoxi Wang
9fe12a256b catch grv_proxy_memory_limit_exceeded in getConsistentReadVersion 2022-09-06 22:18:14 -07:00
Jon Fu
dbb6357371 add conflict range tests and change tenant prefix code to work with RYW 2022-09-06 16:55:57 -07:00
Dennis Zhou
d9e7fc1245 ApiVersion: fix TraceFile apiversion check 2022-09-06 12:02:50 -07:00
Xiaoxi Wang
fda4d6c8ea
Merge pull request #8099 from sfc-gh-xwang/fix/main/spancontextInit
Fixed Valgrind "uninitialised byte(s)" failure by initializing all member in Span
2022-09-06 10:46:08 -07:00
Dennis Zhou
b2ae592b51
Merge pull request #8082 from sfc-gh-vgasiunas/vgasiunas-api-version
ApiVersion: Small cleanups
2022-09-06 10:03:45 -07:00
Vaidas Gasiunas
599e57b5f2
Use distinct base trace file names for client threads (#7922)
* Save thread indexes for client instances in MVC

* An option to inlude client thread identifiers into trace file names

* Avoid using new trace file options in client versions not supporting them

* Remove redundant include generated by IDE

* Use different base trace file names for client threads by default. Provide an option to revert to using a shared base file name

* Fixing typos in the description of trace_share_among_client_threads
2022-09-06 18:46:42 +02:00
Vaidas Gasiunas
8ca8691837 ApiVersion: Minor clean ups 2022-09-05 10:42:42 +02:00
Trevor Clinkenbeard
3ce737b2fa
Merge pull request #8086 from sfc-gh-tclinkenbeard/mark-promisestream-send-nonconst
Mark `PromiseStream::send` non-const
2022-09-04 14:55:47 -07:00
Xiaoxi Wang
9461450081 initialize all members in Span 2022-09-03 15:52:36 -07:00
Ata E Husain Bohra
28e608e717
Encryption data at-rest db-config (#7929)
* Encryption data at-rest db-config

Description

 diff-1: Handle 'force' updates to encryption_at_rest db-config

Major changes proposed:
1. Introduce 'encryption_data_at_rest_mode" 'configure new'
option to enable Encryption data at-rest. The feature is disabled
by default.
2. The configuration is meant to be set at the time of database
creation, addition checks will be done to avoid updating the config
in subsequent PR.
3. DatabaseConfiguration validity check to account for "tenant_mode"
set to `required` if Encryption data at-rest is selected given
EncryptionDomain matches Tenant boundaries.

Testing

devCorrectness - 100K
2022-09-02 14:11:38 -07:00
Josh Slocum
94e0c83214 Blob range idempotency test and fixes 2022-09-02 15:53:06 -05:00
sfc-gh-tclinkenbeard
3dec9749d3 Mark PromiseStream::send non-const 2022-09-02 10:41:56 -07:00
He Liu
0bbce98da2
Disable shard aware (#8072)
* Removed STORAGE_SERVER_SHARD_AWARE knob.

* Fixed PhysicalShardMove test.

Co-authored-by: He Liu <heliu@apple.com>
2022-09-02 09:07:34 -07:00
Josh Slocum
2251ae0fc2
Added summarize blob granules c api and tests (#8076)
* Added summarize blob granules c api and tests

* addressing review comments

* format
2022-09-02 17:08:51 +02: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
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
Josh Slocum
58abda7d15
Merge pull request #8074 from sfc-gh-jslocum/fix_stream_maybe_delivered
Handling request_maybe_delivered in reply promise stream and injecting faults to make sure the code path is exercised
2022-09-01 14:16:57 -05:00
Josh Slocum
663b1b9711 Handling request_maybe_delivered in reply promise stream and injecting faults to make sure the code path is exercised 2022-09-01 12:57:09 -05:00
Nim Wijetunga
72ccc681be move tenant entry cache to client 2022-09-01 10:10:47 -07:00
Josh Slocum
e7a82c9283
Merge pull request #8059 from sfc-gh-jslocum/bw_rk_fix
Adding knob and increasing delay for simulation ratekeeper throttling assert
2022-08-31 15:55:05 -05:00
Josh Slocum
dcfc03a247
Merge pull request #8061 from sfc-gh-jslocum/ss_ebrake_speed_up_sim
Minimizing effect of overly small buggified ss ebrake limits when speed up simulation is set
2022-08-31 15:54:41 -05:00
Jon Fu
4733e5a096 add extra test cases for set/clear/commit 2022-08-31 12:49:42 -07:00
Yi Wu
49503987cc
Support Redwood encryption (#7376)
A new knob `ENABLE_STORAGE_SERVER_ENCRYPTION` is added, which despite its name, currently only Redwood supports it. The knob is mean to be only used in tests to test encryption in individual components, and otherwise enabling encryption should be done through the general `ENABLE_ENCRYPTION` knob.

Under the hood, a new `Encryption` encoding type is added to `IPager`, which use AES-256 to encrypt a page. With this encoding, `BlobCipherEncryptHeader` is inserted into page header for encryption metadata. Moreover, since we compute and store an SHA-256 auth token with the encryption header, we rely on it to checksum the data (and the encryption header), and skip the standard xxhash checksum.

`EncryptionKeyProvider` implements the `IEncryptionKeyProvider` interface to provide encryption keys, which utilizes the existing `getLatestEncryptCipherKey` and `getEncryptCipherKey` actors to fetch encryption keys from either local cache or EKP server. If multi-tenancy is used, for writing a new page, `EncryptionKeyProvider` checks if a page contain only data for a single tenant, if so, fetches tenant specific encryption key; otherwise system encryption key is used. The tenant check is done by extracting tenant id from page bound key prefixes. `EncryptionKeyProvider` also holds a reference of the `tenantPrefixIndex` map maintained by storage server, which is used to check if a tenant do exists, and getting the tenant name in order to get the encryption key.
2022-08-31 12:19:55 -07:00
Josh Slocum
c587135988 Minimizing effect of overly small buggified ss ebrake limits when speed up simulation is set 2022-08-31 13:39:50 -05:00
Josh Slocum
3fcffd899f Merge branch 'main' into bw_rk_fix 2022-08-31 13:05:43 -05:00
Dennis Zhou
046141b5be blob: only allow unblobbification on aligned to ranges
If unblobbify request comes in, reject it if the start and end do not
align to a blob granule boundary.
2022-08-31 09:23:33 -07:00
Dennis Zhou
dc27c9bbd7 blob: add basic pagination to listBlobbifiedRanges() 2022-08-31 09:23:33 -07:00
Dennis Zhou
5b6a1f0675 KeyRangeMap: introduce Unaligned KeyRangMap functions
This allows us to return:
[firstKey, transition points, endKey]
where firstKey <= keys.begin and endKey >= keys.end.

This also fixes a prior issue where we were ending the range with a
larger key's value rather than carrying the largest value within the
range to the end.
2022-08-31 09:23:33 -07:00
Dennis Zhou
65112fbdc0 RYW: fix limits.minRows
limits are being modified inplace for subsequent requests. However,
the updated minRows is being checked against the total result instead of
the original minRows.
2022-08-31 09:23:33 -07:00
Dennis Zhou
15c7331259 blob: fix blobRangeInactive = StringRef() 2022-08-31 09:23:33 -07:00
Josh Slocum
9721de70b6 Adding knob and increasing delay for simulation ratekeeper throttling assert 2022-08-31 09:08:27 -05:00
Yao Xiao
ac7a5823e2
Add knob for CF write buffer size. (#8038) 2022-08-30 17:52:29 -07:00