Commit Graph

28 Commits

Author SHA1 Message Date
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