928 Commits

Author SHA1 Message Date
A.J. Beamon
2eae95aabe Merge branch 'main' into feature-metacluster 2022-07-01 14:07:34 -07:00
A.J. Beamon
aea4d802c6 Merge branch 'main' into feature-metacluster 2022-06-30 15:08:09 -07:00
Josh Slocum
f943efb3b1 Change Feed Reading CPU optimization 2022-06-30 15:32:41 -05:00
Jingyu Zhou
d60cab788e
Merge pull request #7502 from jzhou77/main
Add pipelining for secondary queries in index prefetch
2022-06-30 10:27:29 -07:00
A.J. Beamon
76a147a104
Merge pull request #7496 from sfc-gh-ajbeamon/refactor-tenant-map-encoding
Refactor how tenant map entries are encoded and decoded
2022-06-30 09:48:38 -07:00
Jingyu Zhou
4910f69f60
Update fdbserver/storageserver.actor.cpp
Co-authored-by: Hao Fu <77984096+hfu94@users.noreply.github.com>
2022-06-30 09:19:19 -07:00
Jingyu Zhou
467642ac7f Remove semicolons 2022-06-30 09:12:58 -07:00
Jingyu Zhou
842004f3b3 Code clean-up 2022-06-29 21:29:41 -07:00
Jingyu Zhou
ba5e2ed72d Add batching for secondary queries in index prefetch
This is to reduce excessive load being issued concurrently, controlled by knob
MAX_PARALLEL_QUICK_GET_VALUE.
2022-06-29 21:17:11 -07:00
Jingyu Zhou
da26a4c373 Issue secondary query in parallel for GetMappedKeyValues
In case the subquery is a local miss, it becomes a remote call. Then such an
optimization can significantly reduce latency.
2022-06-29 17:45:10 -07:00
Yi Wu
364644673f
Support TLog encryption in commit proxy (#6942)
This PR add support for TLog encryption through commit proxy. The encryption is done on per-mutation basis. As CP writes mutations to TLog, it inserts encryption header alongside encrypted mutations. Storage server (and other consumers of TLog such as storage cache and backup worker) decrypts the mutations as they peek TLog.
2022-06-29 14:21:05 -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
e1a93988ef Merge branch 'main' into feature-metacluster 2022-06-28 14:58:07 -07:00
A.J. Beamon
899b6267ae Update key backed types to support a templated Codec. This required updating the existing Codec to convert from objects into byte strings through tuples. 2022-06-28 13:45:10 -07:00
Markus Pilman
8af056e7b0 fdbclient now compiling 2022-06-23 18:05:36 -06:00
Markus Pilman
d35445a868 enforce include modularization in cmake 2022-06-23 14:37:35 -06:00
A.J. Beamon
96fad987eb Add new command to get total metacluster capacity. Fix bug where removing a data cluster could make it impossible to create new tenants on it. Add knobs for max data clusters and max tenants. 2022-06-17 10:42:03 -07:00
A.J. Beamon
2907aafa60 Merge branch 'main' into feature-metacluster 2022-06-02 12:18:42 -07:00
Andrew Noyes
53882ef741 Revert most logic in #5637 2022-05-24 12:23:49 -07:00
Josh Slocum
4015b5b2a0
Several Blob Granule bug fixes found in nightlies (#7170)
* Fixing simulation validation assert that was tripping incorrectly

* Commenting out debugging prints

* Fixed multiple error propagation issues in blob worker
2022-05-23 10:07:16 -07:00
Steve Atherton
c073f113a5
Explicitly cancel byte sample recovery on failure of a recovered storage server to prevent it from trying to read from the IKeyValueStore after shutdown. (#7212) 2022-05-20 19:55:52 -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
Ray Jenkins
dcd771bd07
Use semicolon for consistency with all other spans. (#7201) 2022-05-20 10:18:00 -05:00
He Liu
78dc7c5d77 Resolving comments. 2022-05-19 13:27:21 -07:00
He Liu
61490022b4 Enabled checkpoint, restore test for RocksDB format. 2022-05-19 13:27:21 -07:00
He Liu
bc509d9572 Added fetchCheckpointKeyValuesQ in storage server. 2022-05-19 13:27:21 -07:00
Trevor Clinkenbeard
b55b67641c
Fix -Wlogical-op-parentheses warning (#7190) 2022-05-18 12:31:43 -07:00
Hao Fu
f00606fd71
Enable MATCHED and UNMATCHED mode for index prefetch (#7162)
* Enable MATCHED and UNMATCHED mode for index prefetch

MATCHED mode returns index entries whose secondary KVs are present,
UNMATCHED mode returns index entries whose secondary KVs are absent.

Note that the conflict read range of this txn is set in 2 steps:
* Set the conflict range for primary query according to request
* Set the conflict ranges for secondary queries according to responses.

As a result, conflicts of different match_index mode are taken care of.

* Fix c binding
2022-05-18 09:16:28 -07:00
Hao Fu
853e6a346b
Optimization: support removing index conditionally (#7116) 2022-05-13 10:10:43 -07:00
Jingyu Zhou
ed3d759b5e
Merge pull request #7071 from sfc-gh-ajbeamon/fix-mapped-range-tenant-check
Fix bug in interaction between mapped ranges and tenants
2022-05-11 09:23:31 -07:00
hao fu
4804bb21cf Fix comments 2022-05-06 18:01:43 -07:00
hao fu
c01f680d62 add appendRaw and subTupleRawString for Tuple 2022-05-06 18:01:43 -07:00
hao fu
24f6276e14 Eliminate vector string during mapped key processing
There was OOM if we pre-process all the strings.
2022-05-06 08:38:27 -07:00
Hao Fu
f8d3b20994
re-use same arena when construct mapped key (#7066)
* re-use same arena when construct mapped key

ConstructMappedKey seems to be a hotspot, try eliminate unnecessary
operations by
* re-using the same Tuple
* preprocess the formatTuple to get a list of Tuples and strings

* throw  mapper_bad_range_decriptor when range query is not the last element
2022-05-05 12:52:54 -07:00
A.J. Beamon
7ba2be6f30 Update simulator to sometimes create tenants it doesn't use. Fix bug in mapped range where it would fail if any tenants existed and transactions were run not using the tenants. 2022-05-05 10:03:30 -07:00
Hao Fu
c1c316591c
Clean up constructMappedKey method (#7062)
* Clean up constructMappedKey method

* fix comments and bugs

* Fix search index

* Fix bug, if escaped is true after first round, it would skip the second round
2022-05-04 13:37:05 -07:00
Jingyu Zhou
05e63bc703
Fix orphaned storage server due to force recovery (#6914)
* Fix orphaned storage server due to force recovery

The force recovery can roll back the transaction that adds a storage server.
However, the storage server may now at version B > A, the recovery version.
As a result, its peek to buddy TLog won't return TLogPeekReply::popped to
trigger its exit, and instead getting a higher version C > B back. To the
storage server, this means the message is empty, thus not removing itself and
keeps peeking.

The fix is to instead of using recovery version as the popped version for the
SS, we use the recovery transaction version, which is the first transaction
after the recovery. Force recovery bumps this version to a much higher version
than the SS's version. So the TLog would set TLogPeekReply::popped to trigger
the storage server exit.

* Fix tlog peek to disallow return empty message between recoveredAt and recovery txn version

This contract today is not explicitly set and can cause storage server to fail
with assertion "rollbackVersion >= data->storageVersion()". This is because if
such an empty version is returned, SS may advance its storage version to a
value larger than the rollback version set in the recovery transaction.

The fix is to block peek reply until recovery transaction has been received.

* Move recoveryTxnReceived to be per LogData

This is because a shared TLog can have a first generation TLog which is already
setting the promise, thus later generations won't wait for the recovery version.
For the current generation, all peeks need to wait, while for older generations,
there is no need to wait (by checking if they are stopped).

* For initial commit, poppedVersion needs to be at least 2

To get rid of the previous unsuccessful recovery's recruited seed
storage servers.
2022-05-02 17:17:37 -07:00
Ray Jenkins
dc9e782ccc
OpenTelemetry Tracing Perf Fixes (#6990) 2022-05-02 14:56:51 -05:00
Jingyu Zhou
0ca9761088 Fix IDE build warnings and errors 2022-05-01 16:20:57 -07:00
Evan Tschannen
3bab26c01b fix: prevent a storage server from attempting to read the cluster id from itself due to a stale cache entry 2022-04-29 14:56:43 -07:00
Steve Atherton
2678546c00
Merge pull request #6950 from sfc-gh-jslocum/cf_delete_race
Fixing change feed deleted from multiple sources race
2022-04-29 13:58:22 -07:00
Hao Fu
0362beb3f3
Fix limit bug in indexPrefetch (#7004)
limit for getRange was incorrectly set to 1, while
a single logical record is consists of at least 2
keyValue, causing record layer fail to unsplit the
logical record.
2022-04-28 17:44:19 -07:00
Josh Slocum
5d1afd4c04 Fixing change feed deleted from multiple sources race 2022-04-25 16:51:20 -05:00
Ray Jenkins
1c5bf135d5
Revert "Migrate to OpenTelemetry tracing. (#6855)" (#6941)
This reverts commit 5df3bac110d9b5b88931b008b852433688bb7eb0.
2022-04-25 09:29:56 -05:00
Ray Jenkins
5df3bac110
Migrate to OpenTelemetry tracing. (#6855) 2022-04-20 09:26:37 -05:00
Lukas Joswiak
07d11ec2e1 Fix failing upgrades due to non-persisted initial cluster version 2022-04-18 10:59:17 -07:00
Dan Lambright
e43fde16ec formatting 2022-04-08 17:28:16 -04:00
Dan Lambright
1b3b4166c6
Merge branch 'main' into vv 2022-04-08 17:18:13 -04:00
Josh Slocum
6276cebad9
Blob integration (#6808)
* Fixing leaked stream with explicit notify failed before destructor

* better logic to prevent races in change feed fetching

* Found new race that makes assert incorrect

* handle server overloaded in initial read from fdb

* Handling more blob error types in granule retry

* Fixing rollback metadata problem, added better debugging

* Fixing version race when fetching change feed metadata

* Better racing split request handling

* fixing assert

* Handle change feed popped check in the blob worker

* fix: do not use a RYW transaction for a versionstamp because of randomize API version (#6768)

* more merge conflict issues

* Change feed destroy fixes

* Fixing change feed destroy and move race

* Check error condition in BG file req

* Using relative endpoints for blob worker interface

* Fixing bug in previous fix

* More destroy and move race fixes

* Don't update empty version on destroy in case it gets rolled back. moved() and removing will take care of ensuring it is not read

* Bug fix (#6796)

* fix: do not use a RYW transaction for a versionstamp because of randomize API version

* fix: if the initialSnapshotVersion was pruned, granule history was incorrect

* added a way to compress null bytes in printable()

* Fixing durability issue with moving and destroying change feeds

* Adding fix for not fully deleting files for a granule that child granules need to re-snapshot

* More destroy and move races

* Fixing change feed destroy and pop races

* Renaming bg prune to purge, and adding a C api and unit test for it

* more cleanup

* review comments

* Observability for granule purging

* better handling for change feed not registered

* Fixed purging bugs (#6815)

* fix: do not use a RYW transaction for a versionstamp because of randomize API version

* fix: if the initialSnapshotVersion was pruned, granule history was incorrect

* added a way to compress null bytes in printable()

* fixed a few purging bugs

Co-authored-by: Evan Tschannen <evan.tschannen@snowflake.com>
2022-04-08 14:15:25 -07:00
Lukas Joswiak
73a7c32982
Add fdbcli command to read/write version epoch (#6480)
* Initialize cluster version at wall-clock time

Previously, new clusters would begin at version 0. After this change,
clusters will initialize at a version matching wall-clock time. Instead
of using the Unix epoch (or Windows epoch), FDB clusters will use a new
epoch, defaulting to January 1, 2010, 01:00:00+00:00. In the future,
this base epoch will be modifiable through fdbcli, allowing
administrators to advance the cluster version.

Basing the version off of time allows different FDB clusters to share
data without running into version issues.

* Send version epoch to master

* Cleanup

* Update fdbserver/storageserver.actor.cpp

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

* Jump directly to expected version if possible

* Fix initial version issue on storage servers

* Add random recovery offset to start version in simulation

* Type fixes

* Disable reference time by default

Enable on a cluster using the fdbcli command `versionepoch add 0`.

* Use correct recoveryTransactionVersion when recovering

* Allow version epoch to be adjusted forwards (to decrease the version)

* Set version epoch in simulation

* Add quiet database check to ensure small version offset

* Fix initial version issue on storage servers

* Disable reference time by default

Enable on a cluster using the fdbcli command `versionepoch add 0`.

* Add fdbcli command to read/write version epoch

* Cause recovery when version epoch is set

* Handle optional version epoch key

* Add ability to clear the version epoch

This causes version advancement to revert to the old methodology whereas
versions attempt to advance by about a million versions per second,
instead of trying to match the clock.

* Update transaction access

* Modify version epoch to use microseconds instead of seconds

* Modify fdbcli version target API

Move commands from `versionepoch` to `targetversion` top level command.

* Add fdbcli tests for

* Temporarily disable targetversion cli tests

* Fix version epoch fetch issue

* Fix Arena issue

* Reduce max version jump in simulation to 1,000,000

* Rework fdbcli API

It now requires two commands to fully switch a cluster to using the
version epoch. First, enable the version epoch with `versionepoch
enable` or `versionepoch set <versionepoch>`. At this point, versions
will be given out at a faster or slower rate in an attempt to reach the
expected version. Then, run `versionepoch commit` to perform a one time
jump to the expected version. This is essentially irreversible.

* Temporarily disable old targetversion tests

* Cleanup

* Move version epoch buggify to sequencer

This will cause some issues with the QuietDatabase check for the version
offset - namely, it won't do anything, since the version epoch is not
being written to the txnStateStore in simulation. This will get fixed in
the future.

Co-authored-by: A.J. Beamon <aj.beamon@snowflake.com>
2022-04-08 12:33:19 -07:00