Commit Graph

50 Commits

Author SHA1 Message Date
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Ankita Kejriwal 7e424c7386
Stagger storage quota estimation requests and observability improvements (#10759)
* Rename and simplify fetch time variables

* Add RefreshTime detail to TenantCacheGetStorageUsageRefreshSlow trace

* Stagger storage estimation requests

* Update the value of a knob in simulation to reduce flakiness

* Improve names of TenantCache and StorageQuota related traces. Add slow refresh time.

* Convert potentially spammy TenantCache traces to SevDebug
2023-08-15 13:09:24 -07:00
Steve Atherton 53ee26d758 Changed KeyBackedTypes to an actor file. Added TypedKeySelectors for Map and Set classes and getRange() keySelector methods. Added debug macro for KeyBackedTypes. Rewrote KeyBackedRangeMap using keyselectors on KeyBackedMap. 2023-04-18 22:21:19 -07:00
Xiaoxi Wang 213263b5d2 fix unit test failure because of implicit uint16_t conversion to int 2023-03-14 22:23:20 -07:00
Jon Fu ab15478ef9 Merge branch 'main' of github.com:apple/foundationdb into split-tenant-metadata 2023-02-16 10:04:07 -08:00
Junhyun Shim d9c126a2d9
Introduce WipedString for Arena block holding AuthZ tokens (#9381)
* Enable secure allocation mode in Arena

This mode allows zeroing out blocks holding sensitive data after use

* Introduce WipedString to all token-holding memory

Also introduce a option flag "sensitive"

* Make pointer equivalency a hard requirement for non-ASAN builds

So that we can detect when Arena/malloc/memory-wipe behavior changes
2023-02-16 10:44:32 +01:00
Jon Fu 1c0e784a7a attempt to fix broken test workloads 2023-02-10 11:01:59 -08:00
A.J. Beamon 6991b62106 Improve comments on runRYWTransaction*, use MAX_TENANTS_PER_CLUSTER instead of TOO_MANY knob in tenant cache. 2023-02-03 15:35:47 -08:00
A.J. Beamon 72c5abc0f5 Refactor storage quotas to store them in a key backed map in the tenant metadata space 2023-01-25 20:48:17 -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 b10d1f227b Remove tenant name from the TenantInfo object 2023-01-20 14:04:43 -08:00
A.J. Beamon e1d48d28bf Remove tenant name from the TenantInfo object 2023-01-13 08:58:15 -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
Ankita Kejriwal 7382975a6c Add a server knob to control the interval between the trace events 2022-11-15 15:29:28 -08:00
Ankita Kejriwal fabf3361c1 Add a TraceEvent to export the size of tenant groups 2022-11-15 13:08:22 -08:00
Ankita Kejriwal 8bc9a2bffd Add a command to clear storage quota 2022-11-11 17:59:54 -08:00
Ankita Kejriwal abc4b45af1 Set the storage quota on tenant groups instead of tenants
Update all the relevant data structures and monitors accordingly.
2022-11-10 18:56:43 -08:00
Ankita Kejriwal 601b5a2810 Change the list of tenants over storage quota to unordered_set type
This will make lookups more efficient during quota enforcement.
2022-11-03 20:49:44 -07:00
Ankita Kejriwal 38e2fe54b1 Handle `tenant_not_found` error returned by `getEstimatedRangeSizeBytes` 2022-10-28 13:09:44 -07:00
Ankita Kejriwal 56cdb687be Code fixes in TenantCache monitors 2022-10-21 18:12:22 -07:00
Ankita Kejriwal b98366351b Add a function in TenantCache to get list of tenants over storage quota 2022-10-21 16:27:43 -07:00
Ankita Kejriwal c34a23152c Change the storage quota type from unit64_t to int64_t
With this change, the storage quota will be of the same type
as the storage bytes used returned by `getEstimatedRangeSizeBytes`.
2022-10-21 16:18:52 -07:00
Ankita Kejriwal 03fb3d2cfe Simplify how tenants' storage usage is stored in TenantCache 2022-10-21 16:11:13 -07:00
Ankita Kejriwal 7647cea4e5 Improve the storage quota monitor code + add a knob for refresh interval 2022-10-21 15:44:13 -07:00
Ankita Kejriwal a8b1154e45 Move the storage quota monitor from DataDistributor to TenantCache 2022-10-21 15:17:41 -07:00
Ankita Kejriwal f317d114c3 Address code review comments 2022-10-18 18:01:09 -07:00
Ankita Kejriwal 3d890ced9a Code cleanup 2022-10-18 15:53:22 -07:00
Ankita Kejriwal bb702e59e9 Update TenantCache to use the API for tenant-aware getEstimatedRangeSizeBytes 2022-10-18 13:39:06 -07:00
Ankita Kejriwal fb014a4834 Merge branch 'main' of github.com:apple/foundationdb into monitorusage 2022-10-18 13:14:47 -07:00
Bharadwaj V.R beb00b4b7c
Split shards along tenant keyspace boundaries (disabled by default) (#7432)
* Boilerplate code for tenant-aware DD

* Add an DD tenant-cache-assembly actor

* Add basic tenant list monitoring for tenant cache. Tenant cache is not yet a DD-scoped structure

* Create a DDTenantCache class

* Move DDTenantCache to new files

* Tweak some traces; fix placement of build and monitor actor invocations

* Update DD tenant cache refresh to be more efficient and unit-testable

* Fix incorrect use of prefixToID in the DDTenantCache code; it is not correct when the tenant is within a tenant subspace

* Fix a faulty assertion in a DDTenantCache unit test, and add a server knob to switch of DDTenantCache code for the moment

* Fix a DDTenantCache UT bug where count of tenants could be 0, causing divide-by-0 exceptions in the test code; Fix accidental movement of atrace statement; rename some DD tenant-cache related variables

* Make some member DDTenantCache member functions const, and change the ddtc abbreviation to ddTenantCache, for ddtc could refer to DDTeamCollection

* Remove unnecessary assertion that erase-ing an element from a Map really removes it

* Remove the DD prefix in the tenant cache class name (and associated impl and UT class names); there is nothing specific to DD in it; DD uses it; other modules may use it in the future

* Disable DD tenant awareness by default

* Split shards along tenant keyspace boundaries

* Update some naming, switch to using prefixRange and fix a bug in tenantShardSplit

* Reorganize tenant shard splitter

* Moved new header file to new include dir under fdbserver

* Make shardEvaluator trigger shard merger only if adjacent shards belong to the same tenant, if tenant-keyspace boundaries are being honored

* Fix issues in the way shard merge decisions are made based on tenant boundaries

* Minor reorg and bug fix in shard merger decision-making

* Resolve merge issues

* Fix bug in ShardEvaluator that made it run in a loop rather than waiting for metrics changes

* Fix tenant splitter for when start and end are in different shards and only one of them needs to be split

* Remove some uses of printable

* Remove uses of printable

* Fix code formatting

* Add a TENANT_SPLIT RelocateReason and fix errors from incorrect merge of upstream code

* Move tenantCreationSignal ownership to TenantCache

* Update fdbserver/DataDistributionTracker.actor.cpp

Co-authored-by: Xiaoxi Wang <xiaoxi.wang@snowflake.com>

* Fix a couple of bugs and spelling errors in tenantShardSplitter

* Update fdbserver/DataDistributionTracker.actor.cpp

Co-authored-by: Xiaoxi Wang <xiaoxi.wang@snowflake.com>

* Refactor split-merge feasibility check methods

* Merge upstream changes

* Break down tenantShardSplitter to remove dependency on DataDistributionTracker and make the splitter unit-testable

* Add unit tests for tenant shard splitting

* Factor out some repeated code when finding tenant boundaries within a shard

* Extract fault line verification steps used in UTs into a separate function

Co-authored-by: Xiaoxi Wang <xiaoxi.wang@snowflake.com>
2022-09-06 10:53:02 -07:00
Ankita Kejriwal eb541d1036 Add a helper function to get the entire key range with a given prefix 2022-08-23 18:12:36 -07:00
Ankita Kejriwal c47e1b6f53 Add a knob for tenant cache storage usage refresh interval and some minor fixes 2022-08-23 17:52:17 -07:00
Ankita Kejriwal e3ecba105e Monitor storage bytes used by tenants 2022-08-17 14:58:09 -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
Nim Wijetunga 3e45b6657c
Merge pull request #7714 from sfc-gh-nwijetunga/nim/tenant-encryption-property
Encryption as a tenant property
2022-07-29 11:30:19 -07:00
Junhyun Shim c6342a6e5b
Merge branch 'main' into features/authz 2022-07-27 20:51:32 +02:00
Nim Wijetunga 2cd73242de fix merge conflict 2022-07-27 10:58:41 -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
Junhyun Shim e2a3fedfc7
Merge branch 'main' into features/authz 2022-07-27 00:08:57 +02:00
Nim Wijetunga 7cc58cb1af fix pr issues 2022-07-26 10:14:59 -07:00
Nim Wijetunga 26d233c0f8 encryption as a tenant property 2022-07-25 17:19:14 -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 537ceff8ac Remove the ability to configure a tenant subspace. Rename the prefixes used for tenant metadata. 2022-07-19 14:32:05 -07:00
Markus Pilman 2edbcf2c65
Merge pull request #44 from apple/main
Merge main
2022-07-12 07:51:22 -06:00
Markus Pilman 56541167c2 send token with tenant info object 2022-07-06 20:58:17 -06: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
Bharadwaj V.R 8cf2be030f
Build a TenantCache for use by DD (#7207)
* Add an DD tenant-cache-assembly actor
* Add basic tenant list monitoring for tenant cache. 
* Update DD tenant cache refresh to be more efficient and unit-testable
* Remove the DD prefix in the tenant cache class name (and associated impl and UT class names); there is nothing specific to DD in it; DD uses it; other modules may use it in the future
* Disable DD tenant awareness by default
2022-06-21 16:29:30 -07:00