1
0
mirror of https://github.com/apple/foundationdb.git synced 2025-06-02 03:12:12 +08:00

5446 Commits

Author SHA1 Message Date
A.J. Beamon
ff23d5994e
Merge pull request from sfc-gh-ajbeamon/feature-metacluster
Metacluster
2022-08-04 15:29:44 -07:00
Jingyu Zhou
84d483605b
Merge pull request from xis19/main
Let the storage server reports busiest write tag
2022-08-04 10:23:31 -07:00
A.J. Beamon
ff93b345e5 Remove unnecessary deletion of the cluster capacity index 2022-08-04 06:39:58 -07:00
A.J. Beamon
a2e66c9695 Don't buggify the assignment availability timeout too low or it will become impossible to make an assignment 2022-08-03 19:39:20 -07:00
He Liu
fa418fd784
Change SHARD_ENCODE_LOCATION_METADATA to a server knob. ()
Co-authored-by: He Liu <heliu@apple.com>
2022-08-03 13:51:40 -07:00
A.J. Beamon
8e777a6330 Detect and handle inverted ranges in the get cluster list test. Remove some unused code. 2022-08-03 09:09:36 -07:00
Trevor Clinkenbeard
edf4e60fa9
Merge pull request from sfc-gh-tclinkenbeard/global-tag-throttling5
Improvements to `GlobalTagThrottler`
2022-08-02 16:04:20 -07:00
Dennis Zhou
b34a54fa7f
blob: allow for alignment of granules to tuple boundaries ()
* blob: read TenantMap during recovery

Future functionality in the blob subsystem will rely on the tenant data
being loaded. This fixes this issue by loading the tenant data before
completing recovery such that continued actions on existing blob
granules will have access to the tenant data.

Example scenario with failover, splits are restarted before loading the
tenant data:
BM - BlobManager
epoch 3:                        epoch 4:
  BM record intent to split.
  Epoch fails.
                                BM recovery begins.
  BM fails to persist split.
                                BM recovery finishes.
                                BM.checkBlobWorkerList()
                                  maybeSplitRange().
                                BM.monitorClientRanges().
                                  loads tenant data.

bin/fdbserver -r simulation -f tests/slow/BlobGranuleCorrectness.toml \
    -s 223570924 -b on  --crash --trace_format json

* blob: add tuple key truncation for blob granule alignment

FDB has a backup system available using the blob manager and blob
granule subsystem. If we want to audit the data in the blobs, it's a lot
easier if we can align them to something meaningful.

When a blob granule is being split, we ask the storage metrics system
for split points as it holds approximate data distribution metrics.
These keys are then processed to determine if they are a tuple and
should be truncated according to the new knob,
BG_KEY_TUPLE_TRUNCATE_OFFSET.

Here we keep all aligned keys together in the same granule even if it is
larger than the allowed granule size. The following commit will address
this by adding merge boundaries.

* blob: minor clean ups in merging code

1. Rename mergeNow -> seen. This is more inline with clocksweep naming
   and removes the confusion between mergeNow and canMergeNow.
2. Make clearMergeCandidate() reset to MergeCandidateCannotMerge to make
   a clear distinction what we're accomplishing.
3. Rename canMergeNow() -> mergeEligble().

* blob: add explicit (hard) boundaries

Blob ranges can be specified either through explicit ranges or at the
tenant level. Right now this is managed implicitly. This commit aims to
make it a little more explicit.

Blobification begins in monitorClientRanges() which parses either the
explicit blob ranges or the tenant map. As we do this and add new
ranges, let's explicitly track what is a hard boundary and what isn't.

When blob merging occurs, we respect this boundary. When a hard boundary
is encountered, we submit the found eligible ranges and start looking
for a new range beginning with this hard boundary.

* blob: create BlobGranuleSplitPoints struct

This is a setup for the following commit. Our goal here is to provide a
structure for split points to be passed around. The need is for us to be
able to carry uncommitted state until it is committed and we can apply
these mutations to the in-memory data structures.

* blob: implement soft boundaries

An earlier commit establishes the need to create data boundaries within
a tenant. The reality is we may encounter a set of keys that degnerate
to the same key prefix. We'll need to be able to split those across
granules, but we want to ensure we merge the split granules together
before merging with other granules.

This adds to the BlobGranuleSplitPoints state of new
BlobGranuleMergeBoundary items. BlobGranuleMergeBoundary contains state
saying if it is a left or right boundary. This information is used to,
like hard boundaries, force merging of like granules first.

We read the BlobGranuleMergeBoundary map into memory at recovery.
2022-08-02 16:06:25 -05:00
Andrew Noyes
5dbb6f1dd3
Make Tuple::pack return a Standalone<StringRef> ()
This makes it less error-prone and more like other similar functions
like BinaryWriter::toValue

Closes 
2022-08-02 12:45:56 -07:00
Chaoguang Lin
48e46cbc81
Add test coverage for SpecialKeyRangeAsyncImpl::getRange ()
* Add getRange test coverage for SpecialKeyRangeAsyncImpl

* Fix the bug in SpecialKeyRangeAsyncImpl found by the test

* Refactor ConflictingKeysImpl::getRange to use containedRanges to simplify the code

* Fix file format

* Initialize SpecialKeyRangeAsyncImpl cache with correct end key

* Add release notes

* Revert "Refactor ConflictingKeysImpl::getRange to use containedRanges to simplify the code"

This reverts commit fdd298f469bf73b107e5ca29072c49774820d3d6.
2022-08-02 12:04:40 -07:00
Josh Slocum
4b66645d80
Granule file performance benchmark and improvements ()
* added cpu microbenchmark for blob granule files

* Added edge case read benchmarks, and sorting memory deltas

* Sorted merge for granule files

* key block comparison optimization in granule files

* More performance improvements to granule file read

* fixing zlib not supported build

* fixing formatting

* Added debug macro for new debugging prints

* review comments

* more strict compression size validation assert
2022-08-02 11:36:44 -05:00
A.J. Beamon
daa7d3ae72 Remove unused variable 2022-08-02 05:50:58 -07:00
Xiaoge Su
195890dd7b Add ratekeeper ID for storage server busiest write tag report 2022-08-01 18:56:50 -07:00
Xiaoge Su
90b887f394 fixup! Update per comments 2022-08-01 18:56:50 -07:00
Xiaoge Su
542b5e61cf Let the storage server reports busiest write tag
Issue 

The ratekeeper is recording the busiest write tag for *all* storage
servers, which throttles the traceevent. Distribute the busiest write
tag to corresponding storage servers should reduces this throttling
issue.
2022-08-01 18:56:50 -07:00
Ata E Husain Bohra
ef6012c1d1
Encrypt BlobGranule delta files ()
* Encrypt  BlobGranule delta files

Description

 diff-1: Address review comments

Major changes proposed by the patch are:
1. Refactor code to allow caching of 'encryption key ctx' as part of
BlobFilePointerRef. The refactoring allows snapshot and/or delta files
to store their own file encryption context.
2. Enable BlobGranule delta file encryption/decryption semantics.

Testing

BlobGranuleCorrrectness  
BlobGranuleCorrectnessClean
BlobGranuleFileUnitTestToml

Description

Testing
2022-08-01 16:34:44 -07:00
A.J. Beamon
1b693a588a Merge branch 'main' into feature-metacluster 2022-08-01 14:43:14 -07:00
A.J. Beamon
d9df813ce4 Fix a few metacluster accounting bugs 2022-08-01 14:34:21 -07:00
A.J. Beamon
41f519c300 Erase the cluster capacity index entry for a cluster when that cluster is removed 2022-07-30 20:32:43 -07:00
A.J. Beamon
ea76eb2beb Transactions could change tenant ID part way through. The dummy transaction could set a new tenant ID but use the old tenant prefix. 2022-07-30 16:16:18 -07:00
A.J. Beamon
fc92774b2b Fix: cleanup the metadata for a tenant creation that is permanently failed and is being replaced. 2022-07-30 11:08:11 -07:00
A.J. Beamon
0d264f2731 Fix up a few things from review 2022-07-29 15:33:09 -07:00
A.J. Beamon
a69164d160 Merge branch 'main' into feature-metacluster 2022-07-29 11:53:06 -07:00
Nim Wijetunga
3e45b6657c
Merge pull request from sfc-gh-nwijetunga/nim/tenant-encryption-property
Encryption as a tenant property
2022-07-29 11:30:19 -07:00
A.J. Beamon
8b7b6d1d4c Various cleanup; change some test parameters; add a test for metacluster management operations 2022-07-29 09:24:06 -07:00
Josh Slocum
cfc13e7018
Adding more blobrange cli commands and a couple other tweaks () 2022-07-29 08:20:45 -07:00
A.J. Beamon
88d9ef771f Fix a couple bugs 2022-07-29 08:12:15 -07:00
A.J. Beamon
e5bf838c83 Fix metacluster register command hints, fix bug in cluster registration on retries, extend the length of the tenant management concurrency test 2022-07-28 21:02:12 -07:00
Trevor Clinkenbeard
8491c2530f
Merge pull request from sfc-gh-ljoswiak/fixes/change-coordinators-commit-unknown-result
Ensure change coordinators request came from the same generation proxy
2022-07-28 17:29:24 -07:00
A.J. Beamon
e8e4f3ad3a Merge branch 'main' into feature-metacluster
# Conflicts:
#	fdbclient/include/fdbclient/Tenant.h
2022-07-28 16:53:29 -07:00
A.J. Beamon
5db1135ac6 Add MetaclusterOperationContext to make it easier to run multi-transaction operations 2022-07-28 16:44:20 -07:00
Dan Lambright
83d23512d2
Track when version not found in version vector. ()
* Track when version not found in version vector.

* Respond to comments

* include vv in event

* Respond to review comments.

* Fix bug where we logged too many lines
2022-07-28 18:26:15 -04:00
A.J. Beamon
cd19f2cdc2 Add metacluster awareness of the tenant count limit 2022-07-28 15:03:38 -07:00
A.J. Beamon
620467a91b Fix some formatting issues 2022-07-28 13:42:34 -07:00
A.J. Beamon
65cfc839a6 Some various cleanup 2022-07-28 13:35:24 -07:00
A.J. Beamon
4124fb202a Remove extra code 2022-07-28 12:04:08 -07:00
A.J. Beamon
7f53b340f5 Merge branch 'main' into feature-metacluster
# Conflicts:
#	bindings/python/tests/fdbcli_tests.py
#	fdbcli/TenantCommands.actor.cpp
#	fdbclient/ClientKnobs.cpp
#	fdbclient/include/fdbclient/ClientKnobs.h
#	fdbclient/include/fdbclient/Tenant.h
#	fdbserver/BlobManager.actor.cpp
#	fdbserver/BlobWorker.actor.cpp
#	fdbserver/TenantCache.actor.cpp
#	fdbserver/storageserver.actor.cpp
#	fdbserver/workloads/TenantManagementWorkload.actor.cpp
#	flow/include/flow/error_definitions.h
2022-07-28 11:43:21 -07:00
Junhyun Shim
83e94781b4
Merge pull request from sfc-gh-mpilman/features/authz
Authorization
2022-07-28 19:50:24 +02:00
Nim Wijetunga
f07a38b75a use default values 2022-07-27 21:17:28 -07:00
Nim Wijetunga
ed0b1ed030 default init 2022-07-27 19:53:49 -07:00
Nim Wijetunga
dd8bf5076f initalize bool 2022-07-27 18:44:42 -07:00
Jon Fu
e9e388db99 fix formatting 2022-07-27 15:13:09 -07:00
Junhyun Shim
c6342a6e5b
Merge branch 'main' into features/authz 2022-07-27 20:51:32 +02:00
Junhyun Shim
27e2bf60c6 Handle case where exception is thrown before tenant prefix is prepended 2022-07-27 20:13:25 +02:00
Nim Wijetunga
2cd73242de fix merge conflict 2022-07-27 10:58:41 -07:00
Nim Wijetunga
6b525ec053 format 2022-07-27 10:55:58 -07:00
Jon Fu
af7a644037 Merge branch 'main' of github.com:apple/foundationdb into jfu-tenant-rename-special-keys 2022-07-27 09:37:38 -07:00
A.J. Beamon
7c6b3fb0b8 Merge branch 'main' into feature-metacluster 2022-07-27 08:55:10 -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
Nim Wijetunga
50391c35b1 Merge branch 'main' of github.com:sfc-gh-nwijetunga/foundationdb into nim/tenant-encryption-property
* 'main' of github.com:sfc-gh-nwijetunga/foundationdb: (42 commits)
  Get ShardedRocks ready for simulation test. ()
  fixing specific unit test
  formatting
  addressing review comments
  Fix incorrect deserialization of FdbClientLogEvents::Event ()
  Fix a crash bug during CC shutdown process ()
  addressing review comments
  remove runAfter
  Add comments explaining the use of the TransactionState tenant() and hasTenant() functions
  Make sure resumeFromDataMoves() starts after resumeFromShards().
  Fix: during recovery, it was possible for tenant operations to briefly fail because the tenant mode is not known
  formatting
  Fixed granule purging bug and improved debugging for purging
  making purge failures fail test
  cleanup and polish
  Bug fix and cleanup
  First version of key-sorted delta files
  Added full granule read unit test
  Completed delta format unit test
  delta file test and delta generation
  ...
2022-07-27 08:13:30 -07:00