Commit Graph

50 Commits

Author SHA1 Message Date
Xiaoxi Wang a8013bad5c add splitClearRangeByTenant and unit tests 2023-02-01 20:25:56 -08:00
A.J. Beamon fd13bc04c8 Update the tenant maps to be keyed by ID 2023-01-23 14:09:12 -08:00
A.J. Beamon d7b5ee5f09 Merge branch 'main' into storage-server-remove-tenant-names
# Conflicts:
#	fdbserver/storageserver.actor.cpp
2022-12-06 13:02:31 -08:00
A.J. Beamon b1fb8e8c7b Resolve merge issue by renaming namespace (combining with existing TenantAPI namespace) 2022-12-05 15:47:58 -08:00
A.J. Beamon ce4a2a55b2 Remove the usage of tenant names (mostly) from the storage server 2022-12-05 15:44:41 -08:00
A.J. Beamon 7cc79ccf68 Add tenant name to tenant map entry and remove the encrypted field 2022-12-05 12:26:01 -08:00
Jon Fu 93fb151e6c add fdbcli error handling, remove invalid state and change some offset logic 2022-11-10 14:29:01 -08:00
Jon Fu b17c3fecbb add invalid tenant state and assertion in metacluster consistency 2022-10-26 14:37:00 -07:00
Jon Fu f21fcf67ce initial commit to allow tenant list filtering in metacluster 2022-10-25 12:01:29 -07:00
Jon Fu e342a9db43 Merge branch 'main' of github.com:apple/foundationdb into metacluster-assigned-cluster 2022-09-22 14:39:27 -07:00
A.J. Beamon 97a325adab Add an fdbcli command to get tenant group metadata 2022-09-22 13:24:21 -07:00
Jon Fu e91afa15b6 Merge branch 'main' of github.com:apple/foundationdb into metacluster-assigned-cluster 2022-09-22 11:14:27 -07:00
A.J. Beamon 22e24582f1 The base64 decoder was making invalid assumptions about the signedness of the char type. 2022-09-21 14:29:36 -07:00
Jon Fu 4bbc2ad597 Merge branch 'main' of github.com:apple/foundationdb into metacluster-assigned-cluster 2022-09-20 09:34:06 -07:00
Ata E Husain Bohra d2b82d2c46
Introduce "default encryption domain" (#8139)
* Introduce "default encryption domain"

Description

In current FDB native encryption data at-rest implementation,
an entity getting encrypted (mutation, KV and/or file) is categorized
into one of following encryption domains:
1. Tenant domain, where, Encryption domain == Tenant boundaries
2. FDB system keyspace - FDB metadata encryption domain
3. FDB Encryption Header domain - used to generate digest for
plaintext EncryptionHeader.

The scheme doesn't support encryption if an entity can't be categorized
into any of above mentioned encryption domains, for instance, non-tenant
mutations are NOT supported.

Patch extend the encryption support for mutations for which corresponding
Tenant information can't be obtained (Key length shorter than TenantPrefix)
and/or mutations do not belong to any valid Tenant
(FDB management cluster data) by mapping such mutations to a
"default encryption domain".

TODO

CommitProxy driven TLog encryption implementation requires every transaction
mutation to contain 1 KV, not crossing Tenant-boundaries. Only exception to
this rule is ClearRange mutations. For now ClearRange mutations are mapped
to 'default encryption domain', in subsequent patch appropriate handling
for ClearRange mutations shall be proposed.

Testing

devRunCorrectness - 100k
2022-09-14 10:58:32 -07:00
Jon Fu 96f2ce0e43 initial commit to support specifying assignedCluster when creating a tenant 2022-09-09 15:03:59 -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
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
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
Jon Fu 2d363d33a8 fix merge errors 2022-08-15 08:59:45 -07:00
Jon Fu 0c85efee43 Merge branch 'main' of github.com:apple/foundationdb into jfu-metacluster-rename 2022-08-14 11:34:16 -07:00
A.J. Beamon 0c7f6a8e0c Add a restoring state for data clusters and a ID -> tenant name index to allow ID lookups. Also add a couple missing tenant state conversions and a missing encrypted check in TenantMapEntry. 2022-08-13 12:49:54 -07:00
Jon Fu 74df84f686 Merge branch 'main' of github.com:apple/foundationdb into jfu-metacluster-rename 2022-08-08 17:49:15 -07: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
Jon Fu d9dc1999c6 metacluster rename before using metacluster operation ctx 2022-07-29 13:43:47 -07:00
A.J. Beamon a69164d160 Merge branch 'main' into feature-metacluster 2022-07-29 11:53:06 -07:00
A.J. Beamon 4124fb202a Remove extra code 2022-07-28 12:04:08 -07:00
A.J. Beamon 7c6b3fb0b8 Merge branch 'main' into feature-metacluster 2022-07-27 08:55:10 -07:00
Nim Wijetunga 33f236a068 merge 2022-07-26 10:37:26 -07:00
A.J. Beamon a64693518a Add support for tenant groups 2022-07-26 09:04:29 -07:00
Nim Wijetunga 26d233c0f8 encryption as a tenant property 2022-07-25 17:19:14 -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
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 17146c484b Use key-backed types for tenants. Add a tenant state field that will be used in upcoming work. Some other tenant related refactoring. 2022-07-21 20:33:28 -07:00
A.J. Beamon 978ca7fb6f Fix some merge related issues 2022-07-20 12:56:00 -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
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
A.J. Beamon 8f77048e95 Add the ability to configure tenant groups in a metacluster 2022-07-18 11:24:49 -07:00
A.J. Beamon 078d0d92ee Use key-backed types for metacluster state 2022-07-14 13:36:59 -07:00
A.J. Beamon aea4d802c6 Merge branch 'main' into feature-metacluster 2022-06-30 15:08:09 -07:00
A.J. Beamon 26b35c07cd Refactor how tenant map entries are encoded and decoded. Add a specific version to the encoding that matches the version used when this feature was introduced (and the only version in which it was used). 2022-06-29 10:58:58 -07:00
A.J. Beamon 4bafe77889 Some refactoring of tenant code:
* extract tenant management into its own file and namespace
* rename the tenant management workload source file
* extract tenant special keys functions to a separate file
* extract some helper functions to GenericTransactionHelper.h
* convert StringRef -> TenantNameRef
* move some TenantMapEntry implementation into the cpp file
* add some helper functions to decode/encode a tenant mode
2022-06-27 12:32:49 -07:00
A.J. Beamon eabd43c0fd Add a workload that creates and deletes tenants simultaneously. 2022-06-07 13:48:12 -07:00
A.J. Beamon 2907aafa60 Merge branch 'main' into feature-metacluster 2022-06-02 12:18:42 -07:00
A.J. Beamon 27aeb0fe48 Some minor refactoring 2022-05-26 12:49:22 -07:00
Xiaoge Su 337ea89ae8 fixup! Fix the test failure in fdbclient/Tenants.cpp 2022-05-24 17:24:23 -07:00
A.J. Beamon d784173f7f Add first implementation of tenant creation and deletion in a metacluster 2022-05-20 15:21:21 -07:00
A.J. Beamon 05495908b8 Implement some tenant tests 2022-03-17 12:10:18 -07:00