4827 Commits

Author SHA1 Message Date
Lukas Joswiak
0783b044fe Add protocol feature 2022-04-12 14:35:09 -07:00
Lukas Joswiak
08a8eb2b37 Check for viable version before deserializing 2022-04-12 14:35:09 -07:00
Sreenath Bodagala
e902ac543a
Merge pull request #6829 from sbodagala/main
Version vector encoding
2022-04-12 14:19:31 -04:00
Sreenath Bodagala
cb3add17b8 - Encode version vector before sending it over the wire.
Encoding methods used:

  - Tag localities: Run length encoding
  - Tag ids: Compact representation
  - Commit versions: delta encoding.

  If "n" is the number of entries in the version vector, with the tags
  spread over "m" data centers, these techniques will reduce the number
  of bytes to represent the version vector from "(11 * n)" bytes to
  "(3 * m + 2 * n)" / "(3 * m + 3 * n)" bytes (depending on the max tag
  id value, and ignoring some constants) in the best case.
2022-04-11 21:03:09 +00:00
Vaidas Gasiunas
ca563466a6
Merge pull request #6401 from sfc-gh-mpilman/features/private-request-streams
Features/private request streams
2022-04-11 18:29:06 +02:00
Ata E Husain Bohra
933e5bbd2e
EncryptKeyProxy server APIs for simulation runs. (#6727)
* EncryptKeyProxy server APIs for simulation runs.

Description

  diff-2: FlowSingleton util class
              Bug fixes
  diff-1: Expected errors returned to the caller

Major changes proposed are:
1. EncryptKeyProxy server APIs:
 1.1. Lookup Cipher details via BaseCipherId
 1.2. Lookup latest Cipher details via encryption domainId.
2. EncyrptKeyProxy implements caches indexed by: baseCipherId &
   encyrptDomainId
3. Periodic task to refresh domainId indexed cache to support
   'limiting cipher lifetime' abilities if supported by
   external KMS solutions.

Testing

EncyrptKeyProxyTest workload to validate the newly added code.
2022-04-11 09:08:42 -07:00
Markus Pilman
64ac66c1d0 fix merge conflict 2022-04-10 14:16:21 -06:00
Markus Pilman
16467262f0 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-10 14:12:37 -06:00
He Liu
bdc22646c1 Introduced fetchCheckpointKeyValues API in StorageServerInterface. 2022-04-08 18:33:39 -07:00
Dan Lambright
9d433c1bef
Merge pull request #6764 from apple/vv
version-vector-prototype to main branch
2022-04-08 18:50:12 -04:00
Dan Lambright
e43fde16ec formatting 2022-04-08 17:28:16 -04:00
Renxuan Wang
938e8ed996 Do not throw lookup_failed when resolving fails.
Instead, return an empty Optional<NetworkAddress>. For resolveWithRetry(), still return NetworkAddress because it retries until succeed.
2022-04-08 14:21:49 -07:00
neethuhaneesha
b7096c410f
Merge pull request #6795 from neethuhaneesha/rocksdb-blocksize
Adding rocksdb block size option.
2022-04-08 14:20:54 -07: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
Trevor Clinkenbeard
ba8fbca038
Merge pull request #6752 from sfc-gh-tclinkenbeard/improve-snapshot-fault-tolerance
Improve fault tolerance of snapshots
2022-04-08 12:46:50 -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
Dan Lambright
c106847e3e
Merge branch 'main' into vv 2022-04-08 15:05:51 -04:00
Dan Lambright
e2c144ba8e fix conflict NativeAPI.actor.cpp 2022-04-08 14:35:20 -04:00
Vaidas Gasiunas
c30caffb66
Merge pull request #6797 from nblintao/fix-get-mapped-range-api-7.1
Fixes #6793: Upgrade from 7.0.0 to 7.1.0 fails because of missing function fdb_transaction_get_mapped_range
2022-04-08 20:21:00 +02:00
Steve Atherton
11a5d14a11
Merge pull request #6108 from sfc-gh-satherton/redwood-header-changes
Redwood page format refactor to support format evolution, forensic analysis and future encryption scheme
2022-04-08 10:59:12 -07:00
Dan Lambright
5bdc525353
Merge branch 'main' into vv 2022-04-08 13:16:04 -04:00
Tao Lin
73ed34d2fb Fixes #6793: Upgrade from 7.0.0 to 7.1.0 fails because of missing function fdb_transaction_get_mapped_range 2022-04-08 09:32:18 -07:00
Markus Pilman
7631d299bf Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-08 09:58:56 -06:00
Jon Fu
1a3b5f78c4 trace sevError if no map entry is found 2022-04-08 10:32:24 -04:00
Jon Fu
68a75dd9cc additional safety checks in the upgrade scenario for GRV cache 2022-04-08 10:17:18 -04:00
sfc-gh-tclinkenbeard
e27b0d9ab5 Merge remote-tracking branch 'origin/main' into improve-snapshot-fault-tolerance 2022-04-07 23:30:16 -07:00
Zhe Wu
e017faa6c4 grey failure detection account for the case where the connection between primary and satellite DC becomes bad. 2022-04-07 17:34:13 -07:00
neethuhaneesha
5311d93c72
Merge pull request #6783 from neethuhaneesha/rocksdbEngineType
Adding warning on configuring rocksdb storage until production tested.
2022-04-07 13:29:12 -07:00
Markus Pilman
bf956f5630 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-07 13:29:27 -06:00
Vaidas Gasiunas
2ff11982cc
Merge pull request #6664 from sfc-gh-jfu/jfu-grv-cache-multi-threaded
Introduce multi-threaded/multi-version client support for GRV caching
2022-04-07 11:49:11 +02:00
Neethu Haneesha Bingi
0d05669c22 Adding rocksdb block size option. 2022-04-06 19:15:17 -07:00
Zhe Wu
5fd494a57b Allow worker health monitor to report recent destroyed peers who currently have roles in transaction systems 2022-04-06 13:33:50 -07:00
Neethu Haneesha Bingi
5d3981821e Adding warning on configuring rocksdb storage until production tested. 2022-04-06 13:24:57 -07:00
Renxuan Wang
267c4deaee
Add tryGetReplyFromHostname() and retryGetReplyFromHostname(). (#6761)
* Add hostname to coordination interfaces.

* Add tryGetReplyFromHostname() and retryGetReplyFromHostname().

* Change tryGetReplyFromHostname() to call hostname.resolve().

* Add throw for actor_cancelled.
2022-04-06 10:47:00 -07:00
Jon Fu
b0ae22f16d Merge branch 'main' of github.com:apple/foundationdb into jfu-grv-cache-multi-threaded 2022-04-06 12:28:28 -04:00
Jon Fu
124aa6e5fd clean up debug traces and fix details with delRef placement 2022-04-06 12:27:39 -04:00
Xiaoxi Wang
ce33366396
only add mutations can change configuration (#6760) 2022-04-05 17:05:51 -07:00
Steve Atherton
5961b801cc Keep decode caches in page cache based on page height minimum set by a knob with a default value of 2. 2022-04-05 15:11:07 -07:00
Jon Fu
1b9bd597c5 address code review comments and add some traces for manual testing 2022-04-05 15:29:02 -04:00
Josh Slocum
aaaf42525a misc bg operational fixes and improvements 2022-04-05 12:26:00 -05:00
Zhe Wu
1c6dfae48e Making gray failure also monitors connection failures 2022-04-05 09:59:05 -07:00
Dan Lambright
60c55e0785 Merge remote-tracking branch 'origin/version-vector-prototype' into vv 2022-04-05 11:17:39 -04:00
Jingyu Zhou
f68fd28d73 Refactor duplicated code into IKnobCollection::setupKnobs() 2022-04-05 02:06:38 -07:00
Renxuan Wang
465ff712b6
Move Hostname to its own files. (#6759)
* Change DNS cache to use std::map.

Revert commit 90c259d84e95dd35e01149c0a86bd18e82e33930, because if we use unordered_map, toString() can be inconsistent.

* Move ClientKnob::COORDINATOR_HOSTNAME_RESOLVE_DELAY to FlowKnob::HOSTNAME_RESOLVE_DELAY.

* Move Hostname to its own files.

Also, add resolve-related variables and functions in Hostname.
2022-04-04 19:04:51 -07:00
Ray Jenkins
bb9b9d2471
OpenTelemetry API Tracing. (#6478)
* OTEL Span Implementation.

* Addi trace logging, refactor constructors, unit tests.

* Unit tests for creating OTELSpans

* refactor flag names

* Additional comments.

* Formatting.

* Add back Arena.h include

* cleanup header includes

* Remove include cstddef.

* Remove memory include.

* Remove trailing commas on enums.

* Enum formatting.

* Changing SpanStatus enum from ERROR to ERR to see if it is clashing with Windows.h.

* Move OTELEvents to SmallVectorRef<KeyValueRef>.

* Clean up unused includes.

* Unit tests

* Const reference arguments for OTEL constructors and additional addAttribute
unit tests. Adding return of OTELSpan reference on addAttribute.

* Formatting.

* Begin messagepack encoding tests.

* Formatting.

* MessagePack encoding unit tests.

* Formatting.

* Remove swapBinary.

* remove ambiguous helper methods

* Formatting fixes

* Fix ambiguous calls in AddEvents unit tests.

* Include AddAttributes unit test.

* descope windows for UDP encoding test

* Move ifndef WIN32 around MPEncoding unit test.

* Fix AddEvents Attributes size assertion.

* Formatting.

* Enable AddLinks unit test.

* Full MP encoding testing.

* Fix for encoding longer strings with MessagePack and unit test.

* Remove unnecessary header includes and serialize_string_ref function.

* Fix typos

* Update flow/Tracing.actor.cpp

Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>

* Update flow/Tracing.actor.cpp

Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>

* Use ASSERT_WE_THINK and add logging.

We don't want people creating incredibly large traces, so we are only
supporting a subset of MessagePack collection and string sizes. Assert
and log when we hit these unsupported sizes.

* Remove TODOs no longer applicable.

* Refactor OTELEvent to OTELEventRef.

* Remove unnecessary public declaration in struct.

* fix OTELEventRef attribute size assertion

* Formatting

Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>
2022-04-04 17:55:38 -07:00
Jingyu Zhou
5861ff2dc6
Merge pull request #6717 from sfc-gh-ajbeamon/thread-future-safety-check
Disallow anonymous standalone thread futures in safeThreadFutureToFuture
2022-04-04 13:39:37 -07:00
Josh Slocum
cb918b9cef Added basic blob granule consistency check 2022-04-04 11:38:42 -05:00
Josh Slocum
268caa5ac8 fixing shard size knobs outside of simulation 2022-04-04 11:38:18 -05:00
sfc-gh-tclinkenbeard
4f61c86b69 Add MAX_COORDINATOR_SNAPSHOT_FAULT_TOLERANCE knob 2022-04-03 23:28:57 -07:00