Commit Graph

3006 Commits

Author SHA1 Message Date
Bharadwaj V.R 78c4771f9d Fix ProtocolVersion.h formatting diffs 2022-04-14 11:10:39 -07:00
Bharadwaj V.R 3c080c6382
Merge branch 'apple:main' into dbcorever 2022-04-14 10:39:32 -07:00
Bharadwaj V.R 85904ec739
Merge branch 'apple:main' into block-down 2022-04-14 07:23:16 -07:00
Junhyun Shim edc659d339 Use camelCase & move error code to 6xxx 2022-04-13 21:11:52 +02:00
Junhyun Shim b6a0c0f942 Merge remote-tracking branch 'upstream/main' into tenant-token-sign 2022-04-13 19:55:37 +02:00
Bharadwaj V.R 3cbe7f7d63 Update min compatible version to 7.1 2022-04-13 09:47:12 -07:00
Bharadwaj V.R 2f2ece073c Add sw version tracking to DBCoreState 2022-04-13 08:05:22 -07:00
Bharadwaj V.R 3e50dda79f
Merge branch 'apple:main' into block-down 2022-04-13 06:58:59 -07:00
Lukas Joswiak 0783b044fe Add protocol feature 2022-04-12 14:35:09 -07:00
Bharadwaj V.R e4f22e5394
Merge branch 'apple:main' into block-down 2022-04-12 10:50:02 -07:00
Bharadwaj V.R 46b22b79ea Revert "Add SW versions to DBCore state"
This reverts commit 50b45f1bf9.
2022-04-12 10:47:49 -07:00
Aaron Molitor 6b2d0e5d6b update version to 7.2.0 -- protocol version 2022-04-11 23:23:27 -05:00
Aaron Molitor c440365779 update version to 7.2.0 -- pr comment protocol version 2022-04-11 23:23:27 -05:00
Aaron Molitor 8db8545db2 update version to 7.2.0 -- protocol version changes 2022-04-11 23:23:27 -05:00
Bharadwaj V.R 50b45f1bf9 Add SW versions to DBCore state 2022-04-11 12:01:12 -07: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
Bharadwaj V.R 9d00eacfb2
Merge branch 'apple:main' into block-down 2022-04-10 21:50:53 -07:00
Markus Pilman 16467262f0 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-10 14:12:37 -06: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
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
Renxuan Wang f3a8ac21be Change resolve functions in hostname to return network address. 2022-04-08 14:21:49 -07:00
Renxuan Wang a752faf122 resolveFinish should be triggered when resolve succeeds. 2022-04-08 14:21:49 -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
sfc-gh-ngoyal b742149869
Merge pull request #6810 from sfc-gh-ngoyal/misc-fixes
Convert the ScopeEventFieldTypeMismatch event to a Sev40 in simulation.
2022-04-08 12:14:48 -07:00
Dan Lambright c106847e3e
Merge branch 'main' into vv 2022-04-08 15:05:51 -04:00
Ata E Husain Bohra 81c7834d06
Encryption header authentication tokens (#6750)
* Encryption header authentication tokens

Description

  diff-1: Allow NONE AuthTokenMode operations
          Address review comments

Major changes proposed are:
1.Encryption header support two modes of generation 'authentication tokens':
  a) SingleAuthTokenMode: the scheme generates single crypto-secure auth
     token to protect {cipherText + header} payload. Scheme is geared towards
     optimizing cost due to crypto-secure auth-token generation, however,
     on decryption client needs to be read 'header' + 'encrypted-buffer'
     to validate the 'auth-token'. The scheme is ideal for usecases where
     payload represented by the encryptionHeader is not large and it is
     desirable to minimize CPU/latency penalty due to crypto-secure ops,
     such as: CommitProxies encrypted inline transactions,
     StorageServer encrypting pages etc.
  b) MultiAuthTokenMode: Scheme generates separate authTokens for
     'encrypted buffer' & 'encryption-header'. The scheme is ideal where
     payload represented by encryptionHeader is large enough such that it
     is desirable to optimize cost of upfront reading full 'encrypted buffer',
     compared to reading only encryptionHeader and ensuring its sanity;
     for instance: backup-files
2. Leverage full crypto-secure digest as 'authentication token'

Testing

Update EncryptionOps simulation test
Update BlobCipher unit test
20220408-182229-ahusain-foundationdb-7fd2e4b19328cd44
20220408-175754-ahusain-foundationdb-5352e37e1dcabfc8
2022-04-08 11:32:05 -07: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
negoyal 4b77074e21 devFormat 2022-04-08 10:45:29 -07:00
negoyal 9e5c0a782c Convert the ScopeEventFieldTypeMismatch event to a Sev40 in simulation. 2022-04-08 10:30:53 -07:00
Dan Lambright 5bdc525353
Merge branch 'main' into vv 2022-04-08 13:16:04 -04:00
Markus Pilman 7631d299bf Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-08 09:58:56 -06:00
Ray Jenkins 25c5fabc4e
Merge pull request #6798 from sfc-gh-rjenkins/tracing_test_improvements
Simplify MessagePack string decoding logic.
2022-04-08 09:28:53 -05:00
Bharadwaj V.R 597db0b3fd Merge branch 'block-down' of github.com:sfc-gh-bvr/foundationdb into block-down 2022-04-07 14:46:56 -07:00
Bharadwaj V.R 718833f73c
Merge branch 'apple:main' into block-down 2022-04-07 14:46:44 -07:00
Bharadwaj V.R 1e2c4a0844 Rename some variables from clarity; reorganize compatibility test into a new actor 2022-04-07 14:46:27 -07:00
Ray Jenkins 6567409a39 Simplify MessagePack string decoding logic.
Remove use of strcmp, handle reading size in readMPString.
2022-04-07 14:55:35 -05:00
Markus Pilman bf956f5630 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-07 13:29:27 -06:00
Lukas Joswiak 32d4e29e72 Double existing FastAlloc limit 2022-04-07 10:25:10 -07:00
Bharadwaj V.R 58a6442d1f Add tracing and fix the version write and update logic 2022-04-06 21:06:01 -07:00
Yi Wu 994b8c92f8
Add option to limit resident memory and remove default memory limit (#6719)
Changing `memory` option to limit resident memory instead of virtual memory, in config file and fdbserver/fdbbackup/fdbcli command-line argument. Since `rlimit` doesn't support limiting virtual memory, the current implementation have both of fdbmonitor and the fdbserver/fdbbackup process checking process RSS periodically and kill and restart the process if the limit is exceeded.

Adding a new `memory_vsize` option to limit virtual memory, if backward-compatible behavior is desired.

closes #6671, closes #6672
2022-04-06 20:06:24 -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
Andrew Noyes 966402a7a2
Allocate at least sizeof(ArenaBlock) for an ArenaBlock (#6770)
* Allocate at least sizeof(ArenaBlock) for an ArenaBlock

* Fix message pack unit test

Previously we were using only the 4 least significan bits as the length
of a message pack string, but it should be 5 according to https://github.com/msgpack/msgpack/blob/master/spec.md#str-format-family
2022-04-05 18:14:10 -07:00
Dan Lambright 60c55e0785 Merge remote-tracking branch 'origin/version-vector-prototype' into vv 2022-04-05 11:17:39 -04:00
Bharadwaj V.R 1d23d92e40 Fix typo in the name of new error code, and add a few UTs 2022-04-04 19:31:09 -07:00
Renxuan Wang 465ff712b6
Move Hostname to its own files. (#6759)
* Change DNS cache to use std::map.

Revert commit 90c259d84e, 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
Bharadwaj V.R 3fbbf415e7 Properly encapsulate SWVersion and create a couple of UTs for sw version testing 2022-04-04 18:42:52 -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
Renxuan Wang 5a336655f1 Use unordered_map in DNS cache. 2022-04-04 15:08:17 -07:00
Renxuan Wang 7da31857b7 Address comments. 2022-04-04 15:08:17 -07:00
Renxuan Wang e548c0d604 Add DNS cache. 2022-04-04 15:08:17 -07:00
Renxuan Wang ff934ca2ad Change MockDNS to DNSCache. 2022-04-04 15:08:17 -07:00
Renxuan Wang ebe928e7e1 Throw lookup_failed() when hostname resolving fails. 2022-04-04 15:08:17 -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
Steve Atherton 47d1a7b373 Merge commit '38190ad7e787d759f88687e83af0ebabdbc600e8' into redwood-header-changes
# Conflicts:
#	flow/error_definitions.h
2022-04-03 00:39:53 -07:00
Steve Atherton d0152d8442 Fix error description. 2022-04-03 00:37:37 -07:00
Steve Atherton 39fb0a44d7 Merge commit 'f09bdc840c00d712487500b9e752d87cedb1964a' into redwood-header-changes
# Conflicts:
#	fdbserver/VersionedBTree.actor.cpp
2022-04-03 00:37:01 -07:00
Steve Atherton 38190ad7e7
Merge pull request #6737 from sfc-gh-satherton/fix-storage-timestamps
Change storage metadata and perpetual wiggle timestamps to double epoch seconds
2022-04-02 09:47:23 -07:00
Jingyu Zhou 64d4658034 Merge branch 'main' into vv
Fix Conflicts:
	flow/error_definitions.h
2022-04-01 21:49:24 -07:00
Steve Atherton 6eb1c2ae48
Merge pull request #6574 from sfc-gh-satherton/redwood-rare-bugs
Rare correctness bug fixes in Redwood
2022-04-01 16:40:22 -07:00
Bharadwaj V.R a9a84dcafd Merge branch 'apple-main' into block-down 2022-04-01 15:52:18 -07:00
Bharadwaj V.R be70a57cae Merge branch 'main' of https://github.com/apple/foundationdb into apple-main 2022-04-01 15:50:09 -07:00
Bharadwaj V.R 008bd93cce Change the default construction for SWVersion and add error code for sw version incompatibility 2022-04-01 15:45:24 -07:00
Bharadwaj V.R f749aac223
Merge branch 'apple:main' into ssupdateb4registration 2022-03-31 18:59:44 -07:00
Chaoguang Lin 7d365bd1bb
Remote ikvs debugging (#6465)
* initial structure for remote IKVS server

* moved struct to .h file, added new files to CMakeList

* happy path implementation, connection error when testing

* saved minor local change

* changed tracing to debug

* fixed onClosed and getError being called before init is finished

* fix spawn process bug, now use absolute path

* added server knob to set ikvs process port number

* added server knob for remote/local kv store

* implement simulator remote process spawning

* fixed bug for simulator timeout

* commit all changes

* removed print lines in trace

* added FlowProcess implementation by Markus

* initial debug of FlowProcess, stuck at parent sending OpenKVStoreRequest to child

* temporary fix for process factory throwing segfault on create

* specify public address in command

* change remote kv store knob to false for jenkins build

* made port 0 open random unused port

* change remote store knob to true for benchmark

* set listening port to randomly opened port

* added print lines for jenkins run open kv store timeout debug

* removed most tracing and print lines

* removed tutorial changes

* update handleIOErrors error handling to handle remote-ikvs cases

* Push all debugging changes

* A version where worker bug exists

* A version where restarting tests fail

* Use both the name and the port to determine the child process

* Remove unnecessary update on local address

* Disable remote-kvs for DiskFailureCycle test

* A version where restarting stuck

* A version where most restarting tests green

* Reset connection with child process explicitly

* Remove change on unnecessary files

* Unify flags from _ to -

* fix merging unexpected changes

* fix trac.error to .errorUnsuppressed

* Add license header

* Remove unnecessary header in FlowProcess.actor.cpp

* Fix Windows build

* Fix Windows build, add missing ;

* Fix a stupid bug caused by code dropped by code merging

* Disable remote kvs by default

* Pass the conn_file path to the flow process, though not needed, but the buildNetwork is difficult to tune

* serialization change on readrange

* Update traces

* Refactor the RemoteIKVS interface

* Format files

* Update sim2 interface to not clog connections between parent and child processes in simulation

* Update comments; remove debugging symbols; Add error handling for remote_kvs_cancelled

* Add comments, format files

* Change method name from isBuggifyDisabled to isStableConnection; Decrease(0.1x) latency for stable connections

* Commit the IConnection interface change, forgot in previous commit

* Fix the issue that onClosed request is cancelled by ActorCollection

* Enable the remote kv store knob

* Remove FlowProcess.actor.cpp and move functions to RemoteIKeyValueStore.actor.cpp; Add remote kv store delay to avoid race; Bind the child process to die with parent process

* Fix the bug where one process starts storage server more than once

* Add a please_reboot_remote_kv_store error to restart the storage server worker if remote kvs died abnormally

* Remove unreachable code path and add comments

* Clang format the code

* Fix a simple wait error

* Clang format after merging the main branch

* Testing mixed mode in simulation if remote_kvs knob is enabled, setting the default to false

* Disable remote kvs for PhysicalShardMove which is for RocksDB

* Cleanup #include orders, remove debugging traces

* Revert the reorder in fdbserver.actor.cpp, which fails the gcc build

Co-authored-by: “Lincoln <“lincoln.xiao@snowflake.com”>
2022-03-31 17:08:59 -07:00
Bharadwaj V.R 8ff3b7d8a2
Merge branch 'apple:main' into ssupdateb4registration 2022-03-31 16:12:06 -07:00
Tao Lin 001909be08
Fixes for when getMappedRange cannot parse as tuple (#6665) 2022-03-31 14:06:45 -07:00
Jingyu Zhou 4fd414a8ed Merge branch 'main' into vv
Fix Conflicts:
	fdbclient/NativeAPI.actor.cpp
2022-03-31 09:38:36 -07:00
Bharadwaj V.R 60c146bd30
Merge branch 'apple:main' into block-down 2022-03-31 00:11:44 -07:00
Bharadwaj V.R c009eba7ed Add last-sw-version tracking to SWVersion structure 2022-03-31 00:09:58 -07:00
Jingyu Zhou cfcf0f152c Merge branch 'main-4a085fc84' into vv
Fix Conflicts:
	fdbclient/NativeAPI.actor.cpp
	fdbserver/ClusterRecovery.actor.cpp
	fdbserver/MasterInterface.h
	fdbserver/masterserver.actor.cpp
	flow/error_definitions.h
2022-03-30 22:28:06 -07:00
Bharadwaj V.R 88c8b5f2a9
Merge branch 'apple:main' into ssupdateb4registration 2022-03-30 21:16:55 -07:00
Jingyu Zhou b34f4052cd Merge branch 'main-f28dfc12b' into vv
Fix Conflicts:
	fdbclient/MultiVersionTransaction.actor.cpp
	fdbclient/NativeAPI.actor.cpp
	fdbclient/NativeAPI.actor.h
	fdbserver/storageserver.actor.cpp
2022-03-30 21:01:25 -07:00
Jingyu Zhou 00b57d4cce Merge branch 'main-67eba5ec7' into vv
Fix Conflicts:
	fdbclient/CommitProxyInterface.h
	fdbclient/NativeAPI.actor.cpp
	fdbclient/StorageServerInterface.h
	fdbserver/CommitProxyServer.actor.cpp
	fdbserver/storageserver.actor.cpp
2022-03-30 20:05:55 -07:00
Steve Atherton 6744e9e4f9 Change timestamps used in storage server metadata and perpetual wiggle metrics to epoch seconds, stored as doubles, and stringified as either floating point epoch seconds or timestamp strings of the form "2013-04-28 20:57:01.000 +0000". 2022-03-30 18:57:06 -07:00
Steve Atherton 2c9b2dd005 Merge commit '1b919f52e928e8a72d5acba9175eae32ed4b0c90' into redwood-rare-bugs
# Conflicts:
#	flow/ThreadHelper.actor.h
2022-03-30 18:21:03 -07:00
Steve Atherton 84f9e00258 Remove duplicative generic actor repeatEvery() since recurring() exists. 2022-03-30 18:10:29 -07:00
Andrew Noyes 1b919f52e9
Combine vector_like_traits::{insert,reserve} (#6689)
* Combine vector_like_traits::{insert,reserve}

and explain semantics better. This should make it more clear what
implementers need to do when implementing the vector_like_traits
concept.

* Update std::unordered_set vector_like_traits impl
2022-03-30 16:29:35 -07:00
Jingyu Zhou e9659b5dd4 Merge branch 'master-PR-6500' into vv
Fix Conflicts:
	fdbclient/CommitProxyInterface.h
	fdbclient/NativeAPI.actor.cpp
	fdbserver/masterserver.actor.cpp
2022-03-30 14:53:49 -07:00
Steve Atherton 2a52c76b7a Added INetwork::timer_int() for convenience. Clarified what timer_int() actually returns in header comments. 2022-03-30 14:47:24 -07:00
Steve Atherton 75247affa3 Renamed member for better readability. 2022-03-30 13:39:33 -07:00
Steve Atherton 5d74e4d091 Added comments to explain some invariants with ThreadMultiCallback and ThreadCallback and how they are enforced. 2022-03-30 12:38:57 -07:00
Steve Atherton e6457b1656 A few changes for clarity / readability. 2022-03-30 11:31:46 -07:00
Steve Atherton 01facc8dfa Refactored callback tracking in ThreadCallback and ThreadMultiCallback to not use an unordered_map of pointers to prevent it from falsely triggering the DEBUG_DETERMINISM check, plus it is lower overhead, saving about 6% CPU in the AbortableSingleAssignmentVar unit test. 2022-03-29 21:13:13 -07:00
Steve Atherton 971aa2dc4e Refactored callback tracking in ThreadCallback and ThreadMultiCallback to not use an unordered_map of pointers to prevent it from falsely triggering the DEBUG_DETERMINISM check, plus it is lower overhead, saving about 6% CPU in the AbortableSingleAssignmentVar unit test. 2022-03-29 21:09:26 -07:00
A.J. Beamon ce99f4ec30 Disallow anonymous thread futures in safeThreadFutureToFuture when those thread futures contain a standalone type. 2022-03-29 15:50:31 -07:00
Markus Pilman b595d4462f Throw error on unauthorized access 2022-03-29 14:58:43 -06:00
Bharadwaj V.R 726cb3a18f merge commits from main 2022-03-28 22:49:03 -07:00
Steve Atherton 478ff1eb76
Merge pull request #6652 from sfc-gh-anoyes/anoyes/fast-alloc
Move most usage of FastAlloc to malloc
2022-03-26 15:46:05 -07:00
Ata E Husain Bohra 86e201001e
Extend flat_buffer to support unordered_set (de)serialize (#6681)
* Extend flat_buffer to support unordered_set (de)serialize

Extend flat_buffer to support unordered_set (de)serialize

Description

Extend flat_buffer to support unordered_set (de)serialize

Testing

Added unit test in flat_buffers.cpp to validate the functionality:
1. Empty unordered_set (de)serialize
1. Non-Empty unordered_set (de)serialize
2022-03-25 14:29:43 -07:00
Junhyun Shim 99fe104f98 Sign and verify auth tokens for multi-tenant FDB 2022-03-24 19:04:00 +01:00
Ata E Husain Bohra 017709aec6
Introduce BlobCipher interface and cipher caching interface (#6391)
* Introduce BlobCipher interface and cipher caching interface

 diff-3: Update the code to avoid deriving encryption key periodically.
         Implement EncyrptBuf interface to limit memcpys.
         Improve both unit test and simulation to better code coverage.
 diff-2: Add specific error code for OpenSSL AES call failures
 diff-1: Update encryption scheme to AES-256-CTR. Minor
         updates to Header to capture more information.

Major changes proposed are:
1. Introduce encyrption header format.
2. Introduce a BlobCipher cipher key representation encoding
following information: baseCipher details, derived encryption cipher
details, creationTime and random salt.
3. Introduce interface to support block cipher encrytion and decrytion
operations. Encyrption populates encryption header allowing client to
persist them on-disk, this header is then read allowing decryption
on reads.
4. Introduce interface to allow in-memory caching of cipher keys. The
cache allowing mapping of "encryption domain" -> "base cipher id" ->
"derived cipher keys" (3D hash map). This cache interface will be used
by FDB processes participating in encryption to cache recently used
ciphers (performance optimization).

Testing:
1. Unit test to validate caching interface.
2. Update EncryptionOps simulation test to validate block cipher
operations.
2022-03-24 07:31:49 -07:00
Bharadwaj V.R 3a67faca7a Re-register SSI as ready to accept requests 2022-03-22 13:41:06 -07:00
Andrew Noyes 779fb4ca7e Use malloc for PacketBuffer 2022-03-22 11:01:33 -07:00
Andrew Noyes 3b7389fbc5 Use malloc for > 256 in FastAllocated, allocateFast, Arena 2022-03-22 11:01:33 -07:00
Andrew Noyes 8a35f03a18 Use allocateFast4kAligned instead of duplicating its logic 2022-03-22 11:01:33 -07:00
Josh Slocum f27475e2f4 Merge branch 'main' into blob_integration 2022-03-22 11:41:58 -05:00
Steve Atherton 9f205217a4 Merge branch 'main' of https://github.com/apple/foundationdb into redwood-rare-bugs-6574 2022-03-21 21:57:57 -07:00
Trevor Clinkenbeard 6390d93efd
Merge pull request #6646 from sfc-gh-tclinkenbeard/fix-copyright-headers
Update copyright header dates
2022-03-21 16:49:20 -07:00
sfc-gh-tclinkenbeard a71099471b Update copyright header dates 2022-03-21 13:36:23 -07:00
Steve Atherton 074698cdb1
Added 16k magazine size to memory stats. (#6639) 2022-03-21 13:30:27 -07:00
Jingyu Zhou fb046c0665
Merge pull request #6615 from sfc-gh-tclinkenbeard/add-missing-copyright-headers
Add missing copyright headers
2022-03-21 13:17:15 -07:00
Markus Pilman 35f7843d84 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-03-21 12:33:53 +01:00
Markus Pilman 1fbeca8038 fix memory issue 2022-03-19 11:03:32 +01:00
Steve Atherton 5798674e86
Merge pull request #6628 from sfc-gh-satherton/redwood-small-mem-reduction
Redwood small memory usage reductions and a small CPU reduction
2022-03-18 16:22:17 -07:00
sfc-gh-tclinkenbeard 2c52d28ae2 Merge remote-tracking branch 'origin/main' into arena-get-size-boolean-param 2022-03-17 23:12:54 -07:00
Steve Atherton e0990fd712 Added generic detach() actor to allow large actor footprints to be freed once finished, used it to avoid storing writePhysicalPage actors in the page cache. 2022-03-17 19:58:20 -07:00
Xiaoge Su 99b030c2f6 Allow the TOML file assign knobs during test
In this patch, for a given test, it is possible to override the knob
values, e.g.

[[test]]

    [[test.knobs]]
    watch_timeout = 999

will set the client knob WATCH_TIMEOUT to 999 during the test. The
original value will be recovered after the test is over.
2022-03-17 16:53:10 -07:00
Josh Slocum 37e7c80f26 Merge branch 'main' into blob_integration 2022-03-17 18:45:42 -05:00
Andrew Noyes 68c03a7e32
Jemalloc integration fixes (#6626)
* Set default for USE_JEMALLOC initially in ConfigureCompiler

Instead of trying to change the value later on. This fixes the valgrind
build, which was previously incorrectly getting jemalloc involved.

* Check aligned_alloc result for null

And OOM if so - don't assert

* Check that we can allocate magazines with no internal fragmentation

We may want to do this so that the jemalloc heap profiler has some
knowledge of FastAlloc

* Populate TestFile field for noSim tests in TestHarness

* Remove handling for nonexistent "ActualRun"
2022-03-17 15:17:27 -07:00
Markus Pilman 158da462f7 fix memory bug 2022-03-17 14:37:05 +01:00
Markus Pilman 118b53b7cf Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-03-17 12:06:44 +01:00
sfc-gh-tclinkenbeard 44b0e05538 Merge remote-tracking branch 'origin/main' into arena-get-size-boolean-param 2022-03-16 22:53:30 -07:00
Steve Atherton 6cef85e268 Change assertions to not rely on the first argument being evaluated before the second. 2022-03-16 19:00:26 -07:00
sfc-gh-tclinkenbeard 0ae9ba5fd0 Add FastInaccurateEstimate boolean parameter for Arena::getSize 2022-03-16 16:54:27 -07:00
Andrew Noyes ccc11cbdb2
Apply jemalloc fix, and always build jemalloc (#6610)
* Apply jemalloc fix, and always build jemalloc

See https://github.com/jemalloc/jemalloc/pull/1924

* Move USE_JEMALLOC to flow/config.h

* Add unit test to validate fix
2022-03-16 13:19:28 -07:00
sfc-gh-tclinkenbeard 1aabbb07d2 Add missing copyright headers 2022-03-16 11:25:02 -07:00
Steve Atherton 59762fc784
Merge pull request #6423 from sfc-gh-satherton/redwood-bug-fixes-and-memory-leak
Redwood memory usage and small memory leak fixes
2022-03-15 16:52:28 -07:00
He Liu c3a68d661e
Physical Shard Move (#6264)
Physical Shard Move part I: Checkpoint creation, transfer and restore.
2022-03-15 13:03:23 -07:00
A.J. Beamon e8077b65e1
Merge pull request #6559 from sfc-gh-ajbeamon/fdb-tenant-client
Add client support for tenants
2022-03-15 12:40:17 -07:00
Jingyu Zhou e89ee7d5a0
Merge pull request #6589 from sfc-gh-tclinkenbeard/fix-typos
Fix typos
2022-03-15 10:10:23 -07:00
A.J. Beamon ecccfd0868 Add cache invalidation to tenant cache. Send tenant ID along with tenant name in requests to validate that the tenant hasn't changed. Fix a few bugs. 2022-03-15 09:23:30 -07:00
Markus Pilman 117ee637db Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-03-15 17:17:47 +01:00
Markus Pilman bed799220a Addressed review comments, added test 2022-03-15 16:57:26 +01:00
Jingyu Zhou 800478ad5e Add a new client error code stale_version_vector 2022-03-14 20:50:12 -07:00
Trevor Clinkenbeard 6a28bddd35
Fix file names in copyright headers (#6578) 2022-03-14 13:24:25 -07:00
sfc-gh-tclinkenbeard 8dcac2f76d Fix typos 2022-03-13 10:02:11 -03:00
Jingyu Zhou e371854103 Fix the reserve() of flat_map traits
By actually reserving with the given size for PR #6575.
2022-03-11 17:25:04 -08:00
Mohamed Oulmahdi 9e81945301 Enable encryption for Windows 2022-03-11 10:06:07 +01:00
Jingyu Zhou 5450b740ac Use boost::flat_map for better performance
bench_vv_getdelta/512/1024     8768606 ns      8768555 ns           80 Tags=512 getDeltaTimes=1024 items_per_second=116.781k/s
2022-03-10 21:36:03 -08:00
Steve Atherton 8128f9f0b5 Merge branch 'main' of https://github.com/apple/foundationdb into redwood-rare-bugs 2022-03-10 11:28:09 -08:00
Tao Lin e2c7c30faf
GetMappedRange support serializable & check RYW & continuation (#6181) 2022-03-10 10:05:44 -08:00
Yi Wu e6950abae6 Use jemalloc for SQLite/Redwood page cache allocation 2022-03-09 11:48:08 -08:00
Josh Slocum e71b3533f9 Merge branch 'main' into blob_integration 2022-03-09 08:59:56 -06:00
Markus Pilman 8fac0081a8 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-03-09 11:00:00 +01:00
A.J. Beamon 402fa4dd9e
Merge pull request #6428 from sfc-gh-ajbeamon/fdb-tenant-add-interfaces
Add server-side and protocol support for tenants
2022-03-08 15:33:18 -08:00
Steve Atherton 9f690d5bd5 Added StringRef::same() which checks data pointers and lengths for match. Fixed a false negative (but not a bug) in boundariesNormal() and used same() to avoid string comparisons. 2022-03-07 22:44:24 -08:00
Andrew Noyes a827e1cbd5 Flush all output streams in flushAndExit
Also detect reading past the end of the infile for debug_determinism tracing
2022-03-07 13:25:52 -08:00
A.J. Beamon 3ae98189af Server processes send unknown_tenant responses back to clients, which is meant to be retried after updating the tenant cache. Fix bug where key selectors could be truncated after applying the tenant prefix. 2022-03-06 21:54:21 -08:00
A.J. Beamon 72a34945ce Add the ability to disable tenants. Server processes verify the ID of tenants being read or written. 2022-03-06 21:54:21 -08:00
A.J. Beamon c99c7cf55f Apply tenant prefixes on the storage server. The commit proxy can serve tenant location requests. Fix some bugs. 2022-03-06 21:54:21 -08:00
A.J. Beamon 5fa9d3e1b7 Add a tenant parameter to read and commit requests. Store a map of all tenants on commit proxy and storage servers. Add an option to require tenant mode. 2022-03-06 21:54:21 -08:00
Trevor Clinkenbeard b84d3af533
Merge pull request #6499 from sfc-gh-ajbeamon/fix-trace-overflow-bug
Fix possible infinite loop when a trace event is too long
2022-03-04 16:11:37 -08:00
Jingyu Zhou 1a5bf25b5c Update code base to use fmt 8.1.1 2022-03-04 15:52:06 -08:00
A.J. Beamon d45bae11b7 Fix substring call when reporting details about a trace event that was longer than the legal limit. 2022-03-04 13:59:49 -08:00
Andrew Noyes 2bd2ddd779
Fix FastAlloc thread cleanup on OSX (#6485)
* Use ThreadData constructor and destructor

Instead of pthread api

* Make threadData a function static thread local variable

* Fix linux build
2022-03-04 12:49:40 -08:00
A.J. Beamon 1ab963eb5b
Merge pull request #6477 from sfc-gh-ajbeamon/trace-overflow-debug-line
Add some extra print debugging if we overflow the trace buffer
2022-03-01 10:12:09 -08:00
A.J. Beamon beac368ba9 Add a mechanism to enable error backtrace logging for select errors 2022-03-01 09:11:21 -08:00
A.J. Beamon f6b24cd644 Add some extra print debugging if we overflow the trace buffer. 2022-03-01 09:04:15 -08:00
Steve Atherton 73a81a86da Added Redwood metrics printing during set unit test using new generic repeatEvery() actor. 2022-02-26 23:37:30 -08:00
Steve Atherton 6f16702042 Merge branch 'main' of https://github.com/apple/foundationdb into redwood-bug-fixes-and-memory-leak 2022-02-26 18:00:18 -08:00
Renxuan Wang 233c918ffb Replace printf() and fprintf() with fmt::print(). 2022-02-25 19:06:57 -08:00
Renxuan Wang f7eb66441d Try eliminating warnings in macOS and Windows CI builds.
MacOS warnings are format warnings, e.g., `format specifies type 'long' but the argument has type 'Version' (aka 'long long')`.
Windows warnings are `ACTOR does not contain a wait() statement`.
2022-02-25 19:06:57 -08:00
Markus Pilman a61dd41b45 Add an empty test to make sure noSim tests succeed 2022-02-25 15:38:16 -08:00
Andrew Noyes 276cf3a402
Fix minor bugs turned up by _GLIBCXX_DEBUG (#6375)
* Fix a benign bug turned up by _GLIBCXX_DEBUG

Just calling std::vector::operator[] with an out of bounds index at all
is technically undefined behavior.

* Fix compilation issue with _GLIBCXX_DEBUG

For some reason std::max with an initializer list isn't constexpr with
_GLIBCXX_DEBUG set
2022-02-25 13:50:41 -08:00
Andrew Noyes 7a9217a392
Add contrib/debug_determinism (#6389)
* Add contrib/debug_determinism

Add an instrumentation-based technique for debugging unseen mismatches. Also guard a few existing sources of nondeterminism that don't affect unseen with the DEBUG_DETERMINISM macro.

Also change the simulated run loop to not run as the only task inside the real run loop, since that was a source of nondeterminism.

Also fix nondeterminism from calling timer_int

* Add StorageMetadataType::currentTime

Basically a deterministic-in-simulation version of timer_int that we can
use instead of timer_int for StorageMetadataType::createdTime
2022-02-25 12:54:31 -08:00
Mohamed Oulmahdi 5b6098b5be Fix Windows build broken by #6449 2022-02-25 16:25:45 +01:00
Renxuan Wang 06b1d06d38 Support hostname in coordinators commands. 2022-02-24 23:02:29 -08:00
A.J. Beamon d3be393246 Add comments to BaseTraceEvent and TraceEvent. Also make BaseTraceEvent contstructor protected. 2022-02-24 13:29:44 -08:00
A.J. Beamon 250a88e682 Enforce that trace event suppression calls happen first when using trace event call chaining. Fix various instances where we weren't following this requirement. 2022-02-24 12:25:52 -08:00
Markus Pilman f1189e5947
Merge pull request #6384 from vikasgupta8/ppc64le_support
added support for ppc64le
2022-02-24 14:31:31 +01:00
Dan Lambright 8cc9a5af1a Rebase 02/23 2022-02-23 14:23:28 -05:00
Markus Pilman 20bf3e1599 Address review coomments 2022-02-23 19:02:29 +01:00
Markus Pilman cf31e14904 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-02-23 10:29:32 +01:00
Ata E Husain Bohra 344a14b010
Update StreamCipher ctx/cipher management to respect determinism (#6427)
* Update StreamCipher ctx/cipher management to respect determinism

StreamCipher keeps record of CipherKeys created
(including globalCipherKey) to ensure the sensitive data gets
ZERO-OUT and not recorded as part of FDB process dump. However,
in current code it is maintained as an unordered_set indexed
by the object itself. Approach adds non determinism given
object pointer based indexing scheme.

Patch addresses the concern by updating the recording to use
a map indexed by UID.
2022-02-22 17:34:29 -08:00
Markus Pilman dc973fb67e Allow List and first test 2022-02-22 11:15:16 +01:00
Steve Atherton f995b4a502 Merge branch 'main' of https://github.com/apple/foundationdb into redwood-bug-fixes-and-memory-leak 2022-02-18 18:44:28 -08:00
Steve Atherton 735c5697d0 Added fast size estimates to Arena which are O(1) and are usually accurate. When inaccurate, a full size scan will update all estimates in the tree. 2022-02-18 03:25:28 -08:00
Josh Slocum 38a75a8b89 Merge branch 'main' into blob_integration 2022-02-17 17:47:38 -06:00
sfc-gh-tclinkenbeard d01f035848 Increase ITERATIONS_PER_REACTOR_CHECK default 2022-02-17 13:45:17 -08:00
Markus Pilman c7899b9d39 Implemented public endpoints, started allow list 2022-02-16 18:12:03 +01:00
sfc-gh-tclinkenbeard a32547cbbe Merge remote-tracking branch 'origin/main' into flow-enhancements 2022-02-15 15:56:42 -08:00
vikasgupta8 595f50ce26 indentation corrected 2022-02-15 13:03:12 +00:00
root 9bf11ac2f3 Removed condition for arch64 2022-02-11 13:45:17 +00:00
root 459dd83583 resolved format error 2022-02-11 12:11:50 +00:00
root d61519c53d resolved format error 2022-02-11 10:24:56 +00:00
root 15159a5deb resolved format error 2022-02-11 09:57:24 +00:00
vikasgupta8 edfff755bf added support for ppc64le 2022-02-11 06:17:15 +00:00
Sreenath Bodagala c82180501a Merge remote-tracking branch 'apple-upstream/main' into version-vector-prototype 2022-02-10 22:22:34 +00:00
Sreenath Bodagala 72e06369a4 Merge remote-tracking branch 'apple-upstream/main' into version-vector-prototype 2022-02-08 17:47:57 +00:00
sfc-gh-tclinkenbeard acb3e840ac Merge remote-tracking branch 'origin/main' into dd-refactor 2022-02-08 00:33:51 -08:00
sfc-gh-tclinkenbeard 04a1347df2 Merge remote-tracking branch 'origin/main' into dd-refactor 2022-02-08 00:33:27 -08:00
Ray Jenkins e1ae0e03b9 Update flow/Knobs.cpp
Co-authored-by: Lukas Joswiak <lukas.joswiak@snowflake.com>
2022-02-07 15:49:35 -08:00
Ray Jenkins 250b57cc8d Force loopback address when in simulation mode. 2022-02-07 15:49:35 -08:00
Ray Jenkins a5681c52bf Force loopback addr when in simulation mode. 2022-02-07 15:49:35 -08:00
Ray Jenkins 226236600e Preserving original LISTENER_PORT knob and adding new Knob TRACING_UDB_LISTENER_ADDR 2022-02-07 15:49:35 -08:00
Ray Jenkins b588089fe7 formatting 2022-02-07 15:49:35 -08:00
Ray Jenkins 1bd084810c Refactor TRACING_UDP_LISTENER_PORT to TRACING_UDP_LISTENER_ADDR. 2022-02-07 15:49:35 -08:00
Xiaoxi Wang 6dc5921575
createdTime based storage wiggler (#6219)
* add storagemetadata

* add StorageWiggler;

* fix serverMetadataKey bug

* add metadata tracker in storage tracker

* finish StorageWiggler

* update next storage ID

* change pid to server id

* write metadata when seed SS

* add status json fields

* remove pid based ppw iteration

* fix time expression

* fix tss metadata nonexistence; fix transaction retry when retrieving metadata

* fix checkMetadata bug when store type is wrong

* fix remove storage status json

* format code

* refactor updateNextWigglingStoragePID

* seperate storage metadata tracker and store type tracker

* rename pid

* wiggler stats

* fix completion between waitServerListChange and storageRecruiter

* solve review comments

* rename system key

* fix database lock timeout by adding lock_aware

* format code

* status json

* resolve code format/naming comments

* delete expireNow; change PerpetualStorageWiggleID's value to KeyBackedObjectMap<UID, StorageWiggleValue>

* fix omit start rount

* format code

* status json reset

* solve status json format

* improve status json latency; replace binarywriter/reader to objectwriter/reader; refactor storagewigglerstats transactions

* status timestamp
2022-02-04 15:04:30 -08:00
sfc-gh-tclinkenbeard ca7fb0b171 Fix stringop-overflow warning from gcc in StringRef::compare 2022-02-04 14:58:03 -08:00
Markus Pilman 4414df1914
Merge pull request #6279 from sfc-gh-rjenkins/threadname-issue-6064
Make better use of thread names.
2022-02-04 08:46:23 -07:00
A.J. Beamon 1666211252
Merge pull request #6283 from sfc-gh-ajbeamon/adjust-protocol-version
Unset the last bit of the protocol version
2022-02-03 12:26:28 -08:00
Steven Li 36c6e23700
Add TraceEvent severity knob (#6326)
* add knob for trace event severity

* add knob for TraceEvent severity

* fix format

* fix switch format

* moved intToSeverity call inside __test initialization

* updated knob name

* fix line length format

* fix format

* git clang-format
2022-02-02 11:36:17 -08:00
A.J. Beamon 31adbce2f3 Clarify the expectations for the current protocol version and min invalid protocol version in comments. Add static asserts to validate those expectations, where possible. 2022-02-02 10:02:01 -08:00
Ray Jenkins dd45805312
Merge branch 'apple:main' into threadname-issue-6064 2022-02-01 17:40:07 -06:00
Ata E Husain Bohra 591ef57857
Upgrade AES 128 GCM -> AES 256, StreamCipher code refactor (#6314)
* Upgrade AES 128 GCM -> AES 256, StreamCipher code refactor

Major changes proposed are:
1. Refactor StreamCipher code to enable instantiation of
   multiple encryption keys. However, code still retains
   a globalEncryption key semantics used in Backup file
   encryption usecase.
2. Enhance StreamCipher to provide HMAC signature digest
   generation. Further, the class implements HMAC encryption
   key derivation function.
3. Upgrade StreamCipher to use AES 256 GCM mode from currently
   supported AES 128 GCM mode.
   Note: The code changes the encryption key size, however, the
         feature is NOT currently in use, hence, should be OK.
3. Add EncryptionOps validation and benchmark toml supported
   workload, it does the following:
   a. Allow user to configure encrypt-decrypt of a fixed size
      buffer or variable size buffer [100, 512K]
   b. Allow user to configure number of interactions of the runs,
      in each iteration: generate random data, derive an encryption
      key using HMAC SHA256 method, encrypt data and
      then decrypt data. It collects following metrics:
    i) time taken to derive encryption key.
    ii) time taken to encrypt the buffer.
    iii) time taken to decrypt the buffer.
    iv) total bytes encrypted and/or decrypted
   c. Along with stats it basic basic validations on the encrypted
      and decrypted buffer
   d. On completion for test, records the above mentioned metrics
      in trace files.
2022-01-31 19:52:44 -06:00
Trevor Clinkenbeard e6b02532a6
Merge pull request #6192 from sfc-gh-tclinkenbeard/improve-commitbatcher-performance
Make `VectorRefPreserializer` move constructor noexcept
2022-01-31 09:52:51 -08:00
Ray Jenkins 6a1fe2489a format fixes 2022-01-28 18:21:42 -06:00
A.J. Beamon 39a7dc7a2d Add two unit tests for the new hashing functionality 2022-01-28 15:56:58 -08:00