Commit Graph

240 Commits

Author SHA1 Message Date
Jingyu Zhou 70dcff7903
Merge pull request #9194 from sfc-gh-dadkins/sfc-gh-dadkins/commit-debug-typos
Fix some typos in the CommitDebug tags.
2023-01-23 09:26:08 -08:00
Dan Adkins e34c97fe00 Fix some typos in the CommitDebug tags.
s/ApplyMetada/ApplyMetadata/ is not a big deal, but might as well spell it right.

The two identical ApplyMetaDaEffect entries were a little trickier to pick apart
in the logs, when otherwise grouping CommitDebug entries by ID.
2023-01-20 17:35:45 -08:00
A.J. Beamon b10d1f227b Remove tenant name from the TenantInfo object 2023-01-20 14:04:43 -08:00
A.J. Beamon 258198ca20 Merge branch 'main' into transactions-use-tenant-object
# Conflicts:
#	fdbclient/include/fdbclient/DatabaseContext.h
#	fdbserver/workloads/BulkLoadWithTenants.actor.cpp
2023-01-20 09:06:39 -08:00
Nim Wijetunga 82c92abca2
Change Noisy Sev30s to Sev20s (#9180)
change noisy sev30 traces to sev20
2023-01-19 14:06:34 -08:00
Nim Wijetunga 330ac71630
Tenant Deletion Support for Backup Mutation Log (#9103)
tenant deletion support for backup mutation log
2023-01-18 15:11:58 -08:00
A.J. Beamon e1d48d28bf Remove tenant name from the TenantInfo object 2023-01-13 08:58:15 -08:00
Xiaoxi Wang 07b37245dd merge upstream/main; solve merge conflicts 2023-01-12 12:29:03 -08:00
A.J. Beamon 811593e093 Merge branch 'main' into add-tenant-lookup-interface 2023-01-12 09:56:17 -08:00
A.J. Beamon 281083822b Trigger a commit if none happens within some amount of time when a tenant lookup is performed 2023-01-12 09:11:30 -08:00
Xiaoxi Wang 9efba1f5e6 clearify the return type 2023-01-11 15:58:16 -08:00
Xiaoxi Wang 6592ecc3a5 merge upstream/main; confliction solve 2023-01-11 09:33:21 -08:00
Xiaoxi Wang 229565c791 check SetVersionstampedKey offset 2023-01-10 23:58:51 -08:00
Nim Wijetunga 114eb4a3a6
Resolver uses Encryption DB Config (#9002)
Resolver uses encryption DB config
2023-01-10 17:11:14 -08:00
Nim Wijetunga d4cbe20d5f
Cluster Controller uses DB Config (#8992)
CC uses db config for encryption
2023-01-09 12:17:36 -05:00
Xiaoxi Wang 72597f7db6 format code; refactor tenant management workload setup; use fmt::print 2023-01-07 19:43:10 -08:00
Xiaoxi Wang 5bf999cf21 check SetVersionstampedKey 2023-01-06 16:35:07 -08:00
A.J. Beamon f999623bb1 Add a tenant lookup interface and use it when starting transactions 2023-01-06 15:51:12 -08:00
Xiaoxi Wang 8ff6d6c7ee merge upstream/main; solve conflicts 2022-12-17 15:57:07 -08:00
Xiaoxi Wang f4dda44ac8 solve some review comments 2022-12-17 15:42:57 -08:00
Xiaoxi Wang 559161d2b0 modify the validTenantModeAccess to make it easier to read 2022-12-15 12:30:43 -08:00
Andrew Noyes dd0036f09c
Automatically clean old idempotency ids (#9039)
* Add cleanIdempotencyIds

Delete zero or more idempotency ids older than minAgeSeconds

* Automatically clean idempotency ids from first proxy

* Add test for cleaner

* Fix formatting

* Address review comments
2022-12-14 14:24:24 -08:00
Xiaoxi Wang 61e3917d58 check tenant access in applyMetadataToCommittedTransactions 2022-12-14 13:27:50 -08:00
A.J. Beamon e4ee7e3b2e Merge branch 'main' into commit-proxy-tenant-name-refactor 2022-12-13 08:51:13 -08:00
Nim Wijetunga 3a238d638a
Commit Proxy uses Encryption DB Config (#8911)
* add encryption db config

* address pr comments

* address pr comments

* add comments

* cp uses db config

* remove includes

* fix tests

* fix tests

* modify comment

* add encryption enabled method

* modify simulation

* Trigger Build

* change commit proxy encrypt mode fetching

* address pr comments

* address pr comments

* Trigger Build

* Trigger Build

* Trigger Build

* Trigger Build
2022-12-12 21:23:55 -08:00
A.J. Beamon b93136b911 Update tenant maps on the commit proxy to be ID based and not store the full TenantMapEntries 2022-12-07 14:49:37 -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
sfc-gh-tclinkenbeard 3c97f43138 Change Histogram::Unit::microseconds to milliseconds 2022-11-21 08:03:56 -08:00
Ata E Husain Bohra 91fc3fef4a
[EAR]: Remove usage of EncryptDomainName for Encryption at-rest operations (#8715)
* [EAR]: Remove usage of EncryptDomainName for Encryption at-rest operations

Description

 diff-1: Address review comments

EncryptDomainName is an auxillary information, given EAR encryption domain
matches with Tenants, EncryptDomainName maps to TenantName in the current
code. However, this mapping adds EAR depedency has multiple drawbacks:
1. In some scenarios obtaning consistent mapping of TenantId <-> TenantName
   is difficult to maintain. For instance: StorageServer (SS)  TLog mutation
   pop loop, it is possible that same commit batch contains: TenantMap update
   mutation as well as a Tenant user mutation. SS would parse TenantMap update
   mutation (FDB System Keyspace encryption domain), process the mutation, but,
   doesn't apply it to the process local TenantMap. SS then attempts to process,
   Tenant user mutation and fails to decrypt the mutation given TenantMetadaMap
   isn't updated yet.
2. FDB codebase uses EncryptDomainId matching TenantId, TenantName is used as
   an auxillary information source and feels better to be handled by an
   external KMS.

Major changes include:
1. EAR to remove TenantName dependency across all participating processes
   such as: CommitProxy, Redwood, BlobGranule and Backup agent.
2. Update EKP and KmsConnector APIs to avoid relying on "domainName"
   information being passed around to external KMS EAR endpoints.

Testing

devRunCorrectness - 100K
EncryptKeyProxyTest - 100K
EncryptionOps Test - 100K
2022-11-16 10:26:39 -08:00
sfc-gh-tclinkenbeard 9a258e087b Track commit costs while ReportCommitCostEstimationRequest is in-flight 2022-11-16 07:37:00 -08:00
Ankita Kejriwal 3036f2458f
Merge pull request #8803 from sfc-gh-akejriwal/commitproxies
Add a transaction option to bypass storage quota enforcement
2022-11-15 15:22:11 -08:00
sfc-gh-tclinkenbeard 575793db1c In assignMutationsToStorageServers, divide cost of writes across all
storage servers

(write amplification is already handled by
CLIENT_KNOBS->GLOBAL_TAG_THROTTLING_RW_FUNGIBILITY_RATIO)
2022-11-15 15:00:39 -08:00
sfc-gh-tclinkenbeard c03f60c618 Update rare code probe annotations 2022-11-15 13:21:25 -08:00
Ankita Kejriwal 05c914d85f Incorporate code review suggestions 2022-11-14 13:06:27 -08:00
Ankita Kejriwal 2e4cd67fb8 Add a transaction option to bypass storage quota enforcement.
This can be used for transactions that only delete data to allow them to
commit even if the tenant group is over its storage quota.
2022-11-11 16:54:35 -08:00
Ankita Kejriwal 3b4e0056a7 Add a knob to enable/disable storage quota enforcement 2022-11-10 19:35:21 -08:00
Jingyu Zhou 2361acbe22 Change SevWarn to SevInfo for injected errors 2022-11-10 12:10:00 -08:00
Ankita Kejriwal 105648b888 Merge branch 'main' of github.com:apple/foundationdb into commitproxies 2022-11-09 17:38:30 -08:00
Ankita Kejriwal a9c61cc1ef Address code review comments 2022-11-09 17:38:13 -08:00
Ankita Kejriwal 7dde2a755b Reject transactions if the tenant is over quota 2022-11-07 15:59:26 -08:00
Ata E Husain Bohra d853304b18
Refactor CP::WriteMutation to optimize ACTOR alloc/dealloc (#8677)
* Refactor CP::WriteMutation to optimize ACTOR alloc/dealloc

Description

WriteMutation routine is responsible for appending mutations to be persisted
in TLog, the operation isn't a 'blocking' operation, except for few cases
when Encryption is supported by the cluster such
as:
1. Fetch encryption keys to encrypt the mutation.
2. Split ClearRange mutation to respect Encryption domain boundaries.
3. Ensure sanity of already encrypted mutation - simulation limited check.

Patch optimizes the "fast" path by avoiding alloc/dealloc overhead
due to be ACTOR framework support, the penalty happens iff any of above
conditions are met.

Testing

devRunCorrectness - 100K
2022-11-04 07:40:41 -07:00
Ankita Kejriwal 27246dd4e6 Merge branch 'main' of github.com:apple/foundationdb into commitproxies 2022-11-03 18:11:56 -07:00
Ankita Kejriwal cd7e5fad00 Fetch the list of tenants over storage quota onto commit proxies from DD 2022-11-03 17:53:42 -07:00
Andrew Noyes ecb5b5a9ca
Improve keyAfter, singleKeyRange, and an arena usage (#8674)
* Fix a potential memory error

The returned KeyRef should live at least as long as the supplied arena

* Improve keyAfter and singleKeyRange

Avoid duplicating the keyAfter implementation, and share memory between
begin and end for singleKeyRange returning a standalone

* Avoid creating and destroying an arena in a loop

This defeats some of the purposes of Arena's, namely to amortize the
cost of calling malloc and free and to improve cache locality.

* Improve Arena usage

Avoid an arena allocation in keyAfter - instead return a string with
static lifetime. I made sure to return the same memory as was just
brought into cache to inspect whether key == \xff\xff.

Also avoid creating and destroying an arena in a loop for encrypting
idempotency id sets.
2022-11-03 12:33:48 -07:00
A.J. Beamon fc8929cde7 During a restore, the tenant map may not be self-consistent. For example, it is possible for a tenant to exist with two names if it was renamed during a backup. This updates the tenant maps in SS and CP to allow there to be multiple tenants with the same ID, but it expects there to only be one such tenant once the restore is complete and the data is accessed. 2022-11-02 09:05:31 -07:00
Nim Wijetunga 24ce8c0fd0
Commit Proxy Encryption Code Probes (#8618)
* 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
sfc-gh-tclinkenbeard 1d6bd0057b Merge remote-tracking branch 'origin/main' into add-tag-throttling-latency-bands 2022-10-29 09:49:37 -07:00
Andrew Noyes 0a15f081a1
Proactively clean up idempotency ids for successful commits (#8578)
* Proactively clean up idempotency ids for successful commits

This change also includes some minor changes from my branch working on
an idempotency ids cleaner, that I'd like to get merged sooner rather
than later.

- Adding a timestamp to idempotency values
- Making IdempotencyId an actor file
- Adding commit_unknown_result_fatal
- Checking idempotencyIdsExpiredVersion in determineCommitStatus
- Some testing QOL changes

* Factor out decodeIdempotencyKey logic

* Fix formatting

* Update flow/include/flow/error_definitions.h

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>

* Use KeyBackedObjectProperty for idempotencyIdsExpiredVersion

* Add IDEMPOTENCY_ID_IN_MEMORY_LIFETIME knob

* Rename ExpireIdempotencyKeyValuePairRequest

Also add a code probe for the case where an ExpireIdempotencyIdRequest is
received before the count is known, and add an assert

* Fix formatting and add TODO for nwijetunga

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2022-10-28 09:07:54 -07:00
Ankita Kejriwal 438cfea294 Send list of tenants over storage quota to commit proxies 2022-10-26 13:34:12 -07:00