Commit Graph

1759 Commits

Author SHA1 Message Date
Ray Jenkins dc9e782ccc
OpenTelemetry Tracing Perf Fixes (#6990) 2022-05-02 14:56:51 -05:00
Junhyun Shim 41d1c73b9c Fix TokenSign copying and using uninitialized arena
TokenSign was copying unused Arena held by Standalone instead of refering to it.
An Arena has to be used at least once before it holds a valid, copyable reference.
Otherwise the lifecycle of the copied Arena would be its own and not be shared with the original.
Thus, when the copied arena went out of scope,
the memory supposed to be held by returned Standalone also got released.

Fix: instead of copying, refer to Standalone's arena.
2022-05-02 09:48:43 +02:00
Jingyu Zhou 0ca9761088 Fix IDE build warnings and errors 2022-05-01 16:20:57 -07:00
Steve Atherton 1ab5c21967
Merge pull request #6979 from sfc-gh-jslocum/speedup_tail_latency
Don't do huge tail latencies for network requests when speed up simul…
2022-04-29 22:31:35 -07:00
Josh Slocum e5840d3a38 Merge branch 'main' into speedup_tail_latency 2022-04-29 16:05:12 -05:00
Steve Atherton 338d2304d7
Bug fix: Killing a machine process would not wait for AsyncFileNonDurable close operations to finish, causing a later reopen of the same file in a new process to hang forever. Renamed AsyncFileNonDurable::deleteFile to closeFile for clarity. Renamed Machine deletingFiles to deletingOrClosingFiles for clarity. (#7007) 2022-04-29 14:01:18 -07:00
Renxuan Wang c69a07a858
Check in the new Hostname logic. (#6926)
* Revert #6655.

20220407-031010-renxuan-c101052c21da8346           compressed=True data_size=31004844 duration=4310801 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=1:04:15 sanity=False started=100047 stopped=20220407-041425 submitted=20220407-031010 timeout=5400 username=renxuan

* Revert #6271.

20220407-051532-renxuan-470f0fe6aac1c217           compressed=True data_size=30982370 duration=3491067 ended=100002 fail_fast=10 max_runs=100000 pass=100002 priority=100 remaining=0 runtime=0:59:57 sanity=False started=100141 stopped=20220407-061529 submitted=20220407-051532 timeout=5400 username=renxuan

* Revert #6266.

Remove resolving-related functionalities in connection string. Connection string will be used for storing purpose only, and non-mutable.

20220407-175119-renxuan-55d30ee1a4b42c2f           compressed=True data_size=30970443 duration=5437659 ended=100000 fail_fast=10 max_runs=100000 pass=100000 priority=100 remaining=0 runtime=0:59:31 sanity=False started=100154 stopped=20220407-185050 submitted=20220407-175119 timeout=5400 username=renxuan

* Add hostname to coordinator interfaces.

* Turn on the new hostname logic.

* Add the corresponding change in config txns.

The most notable change is before calling basicLoadBalance(), we need to call tryInitializeRequestStream() to initialize request streams first.

Passed correctness tests.

* Return error when hostnames cannot be resolved in coordinators command.

* Minor fixes.
2022-04-27 21:54:13 -07:00
Josh Slocum 1e567c12e8 Don't do huge tail latencies for network requests when speed up simulation is set 2022-04-27 15:04:17 -05:00
Ata E Husain Bohra 333aadb903
Interface to enable clients to send/receive REST requests/responses (#6866)
* Interface to enable clients to send/receive REST requests/responses

Description

Major changes:
1. Add RESTClient interface enabling client to send/receive REST HTTP
   requests. Support REST APIs are: get, head, put, post, delete, trace
2. Add RESTUtil file introducing below interfaces:
 2.1. RESTUrl - Extract URI information: host, service, request-parameters.
 2.2. RESTConnectionPool-
      Connection establishment, life-cycle management, connection-pool (TTL)
 2.3. RESTClientKnobs - supports REST Knob parameter management and updates

Testing

Unit test - fdbrpc/RESTClient, fdbrpc/RESTUtils
2022-04-27 12:17:52 -07:00
Markus Pilman 145f3d15bc implemented token caching 2022-04-26 10:21:22 -06:00
Markus Pilman dc65b7e1c0 fix gcc build error, rename tenantcycle workload 2022-04-25 14:49:48 -06:00
Markus Pilman bf2a723889 fix formatting 2022-04-25 09:03:12 -06:00
Markus Pilman 21336fbf12 Merge remote-tracking branch 'origin/main' into features/authz 2022-04-25 08:45:23 -06:00
Markus Pilman ccf97eb187 Make transport work 2022-04-22 17:06:05 -06:00
Markus Pilman 1da1f8cc0f Fix memory issue 2022-04-21 14:12:16 -06:00
Renxuan Wang e40cc8722c
A few hostname improvements. (#6825)
* Add tryResolveHostnames() in connection string.

* Add missing hostname to related interfaces.

* Do not pass RequestStream into *GetReplyFromHostname() functions.

Because we are using new RequestStream for each request anyways. Also, the passed in pointer could be nullptr, which results in seg faults.

* Add dynamic hostname resolve and reconnect intervals.

* Address comments.
2022-04-20 13:42:46 -07:00
Markus Pilman b61c9ab329 Merge remote-tracking branch 'origin/main' into features/authz 2022-04-20 14:40:14 -06:00
Binglin Chang 408c0cf1c9
Fix compile errors on ubuntu 20.04 (#4931) 2022-04-20 10:00:46 -07:00
Markus Pilman 28bfcbe259 fixed code formatting 2022-04-16 11:37:33 -06:00
Markus Pilman 436d15ea98 Implemented token management and testing
Code is still untested at this point, but testing code was written

Implemented token management and testing

Code is still untested at this point, but testing code was written
2022-04-16 11:29:13 -06:00
Markus Pilman 68405bf3c9 Merge remote-tracking branch 'origin/main' into features/authz 2022-04-14 11:36:41 -06:00
Markus Pilman 577f0dca99 Make context variables type safe 2022-04-14 11:24:19 -06:00
Junhyun Shim edc659d339 Use camelCase & move error code to 6xxx 2022-04-13 21:11:52 +02:00
Markus Pilman 420a901938 Added verification logic 2022-04-13 12:30:18 -06:00
Junhyun Shim b6a0c0f942 Merge remote-tracking branch 'upstream/main' into tenant-token-sign 2022-04-13 19:55:37 +02:00
Markus Pilman 6667e8e5a9 remove unneeded serializer option from TenantInfo 2022-04-12 13:47:47 -06:00
Markus Pilman f9eca3884b implemented base logic 2022-04-12 12:02:43 -06:00
Markus Pilman f6a7b85506 Merge remote-tracking branch 'origin/main' into tenant-token-sign 2022-04-11 11:10:15 -06:00
Markus Pilman 099385928c Address review comments 2022-04-11 09:17:10 -06: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
Markus Pilman d8a0b57b6c clients have to listen on a port in simulation 2022-04-10 14:09:15 -06: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 70c49b1b87 DNS cache entry should also be removed in tryGetReplyFromHostname(). 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 3290c81f1d Fix tryGetReplyFromHostname(). 2022-04-08 14:21:49 -07: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
Markus Pilman 7631d299bf Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-08 09:58:56 -06:00
Zhe Wu ebb60f690b Fix valgrind error in HealthMonitor 2022-04-07 15:48:06 -07:00
Markus Pilman bf956f5630 Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-04-07 13:29:27 -06:00
Markus Pilman e2d7d4075d multiple bug fixes 2022-04-07 11:08:07 -06: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
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
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
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
Yi Wu acfee48894 AsyncFileKAIO: add latency histograms 2022-03-30 10:45:04 -07:00
Markus Pilman b595d4462f Throw error on unauthorized access 2022-03-29 14:58:43 -06:00
sfc-gh-tclinkenbeard 77786f4fc6 Merge remote-tracking branch 'origin/main' into change-data-hall 2022-03-27 12:44:05 -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
Junhyun Shim 410a422bd7 Use Standalone instead of embedded Arenas
- Repeat TokenSign test 100 times per run instead of 1
- Test for verify fail case
2022-03-25 14:03:37 +01:00
Junhyun Shim 9f3fa5ba9b Fix clang format 2022-03-24 19:12:34 +01:00
Junhyun Shim 99fe104f98 Sign and verify auth tokens for multi-tenant FDB 2022-03-24 19:04:00 +01: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
sfc-gh-tclinkenbeard a71099471b Update copyright header dates 2022-03-21 13:36:23 -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
Josh Slocum 8205771e8f ReplyPromiseStreams need synchronous disconnect to avoid change feed races 2022-03-18 17:05:12 -05: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
Evan Tschannen 7908ea54f3 fix: NetNotifiedQueueWithAcknowledgements could miss disconnects that happen during the delay(0) in deliver() 2022-03-17 09:57:46 -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 320c115c71 Apply clang-format to mis-formatted files 2022-03-16 14:25:32 -07:00
sfc-gh-tclinkenbeard 58de6e22cc Add BalanceOnRequests boolean parameter for ModelInterface 2022-03-16 14:25:32 -07:00
Trevor Clinkenbeard 765e018afb
Merge pull request #6580 from sfc-gh-tclinkenbeard/const-smoother
Mark `Smoother::smooth*` methods `const`
2022-03-16 13:43:25 -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
Markus Pilman 117ee637db Merge remote-tracking branch 'origin/main' into features/private-request-streams 2022-03-15 17:17:47 +01:00
Markus Pilman f346a7ea1c Fix Windows build 2022-03-15 17:15:26 +01:00
Markus Pilman bed799220a Addressed review comments, added test 2022-03-15 16:57:26 +01:00
sfc-gh-tclinkenbeard baec03090e Fix "guarantee" misspelling 2022-03-14 16:33:09 -07:00
sfc-gh-tclinkenbeard 8dcac2f76d Fix typos 2022-03-13 10:02:11 -03:00
Josh Slocum a2bbb188c3 Fixing delayed health updater to mark address failed when too many connections triggers before new connection starts, instead of after 2022-03-11 16:50:38 -06:00
sfc-gh-tclinkenbeard 82f709c9d3 Use CRTP to remove duplicate code from Smoother.h 2022-03-11 08:40:24 -04:00
sfc-gh-tclinkenbeard 3a6568580a Improve encapsulation of TimerSmoother 2022-03-11 07:47:26 -04:00
Mohamed Oulmahdi 9e81945301 Enable encryption for Windows 2022-03-11 10:06:07 +01:00
sfc-gh-tclinkenbeard 9aca5f8011 Mark several methods const 2022-03-11 00:47:35 -04:00
sfc-gh-tclinkenbeard a7bce77987 Mark Smoother::smooth* methods const 2022-03-11 00:44:43 -04: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 b21d0943b9 client-focused cleanup 2022-03-09 10:01:25 -06: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
Josh Slocum 04f678d515 Fixing sample logic 2022-03-07 11:20:24 -06:00
Josh Slocum 665e182bcc TSS Metrics improvements 2022-03-07 11:20:24 -06:00
Steve Atherton f03c0b8c3c Added ISimulated::restarted for detecting a restarted simulation test. 2022-03-04 17:19:46 -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 cdebda35ab
Merge pull request #5725 from sfc-gh-jfu/jfu-grv-cache
Add transaction option for clients to use cached read versions
2022-03-04 09:17:27 -08:00
sfc-gh-tclinkenbeard db8def68db Use std::unique_ptr for ISimulator::extraDB 2022-02-28 13:12:31 -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
Markus Pilman 0aa7823622 Pass object as reference 2022-02-25 14:54:52 +01: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 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
Markus Pilman 102169ba33 Ran clang-format 2022-02-23 10:23:27 +01:00
Jon Fu 2e2c8bf88c Merge branch 'main' of github.com:apple/foundationdb into jfu-grv-cache 2022-02-22 12:43:55 -05:00
Markus Pilman dc973fb67e Allow List and first test 2022-02-22 11:15:16 +01:00
Mohamed Oulmahdi d32d18ea64 Fix purgeOutdatedHistory 2022-02-18 11:47:44 +01:00
Josh Slocum 38a75a8b89 Merge branch 'main' into blob_integration 2022-02-17 17:47:38 -06:00
Markus Pilman c7899b9d39 Implemented public endpoints, started allow list 2022-02-16 18:12:03 +01:00
Jon Fu d399daebed Merge branch 'main' of github.com:apple/foundationdb into jfu-grv-cache 2022-02-15 15:09:40 -05:00
Trevor Clinkenbeard 3b4cbded96
Merge pull request #6374 from sfc-gh-ajbeamon/protocol-version-pretty-print
Log protocol version as a hex string rather than a uint64_t
2022-02-14 13:51:00 -08:00
Jon Fu 7492b755d8 Merge branch 'main' of github.com:apple/foundationdb into jfu-grv-cache 2022-02-14 14:06:49 -05:00
A.J. Beamon 1b7e790211 When inserting multiple streams into an EndpointMap, don't assign them in the well-known endpoint space 2022-02-11 12:59:12 -08:00
Josh Slocum 99628bd3b5 Handling replyPromiseStream already disconnected 2022-02-10 19:02:12 -06:00
A.J. Beamon 0a1bcf7a29 Log protocol version as a hex string rather than a uint64_t. 2022-02-10 13:57:48 -08:00
Jon Fu 458e708272 addressed code review comments: renamed variables, small functional changes, style changes 2022-02-10 16:17:54 -05:00
Jon Fu 9c0a512cf5 Merge branch 'main' of github.com:apple/foundationdb into jfu-grv-cache 2022-02-07 14:51:12 -05:00
Markus Pilman 4ea825077b Added public interfaces 2022-02-07 09:03:34 -07:00
Josh Slocum c695958823 remove old actor 2022-02-04 17:24:37 -06:00
Josh Slocum ddfc301d74 Improving memory footprint of change feeds and making it configurable 2022-02-04 16:41:25 -06:00
Josh Slocum 2592c3f0ae Implemented less efficient version of reply stream closing 2022-02-03 20:07:49 -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
Renxuan Wang 2ea4146e1f Add resolveTCPEndpointBlocking() to resolve hostnames where async resolving is impossible. 2022-01-28 12:20:41 -08:00
Ata E Husain Bohra 87ee4cf958 Add new FDB EncryptKeyProxy role
Major changes includes:

1. Add a new FDB role responsible- EncyrptKeyProxy. The role is
   responsible to expose APIs to fetch encyrption keys interacting
   with external Encryption KeyManager interface.
2. The process is a FDB singleton process following similar recruitment
   rules as other singleton processes in the system.
3. Code to recruit the worker process; given the encryption keys are
   needed during recovery (decode TLog records), for now the process
   is co-located in same datacenter as ClusterController.
4. Skeleton process actor code; more functionality will be added in
   subsequent PRs.

NOTE: The code is protected under a SERVER_KNOB with the default
      value as 'false' for now.
2022-01-25 17:38:27 -08:00
Jon Fu 915e2f6c1c Merge branch 'main' of github.com:apple/foundationdb into jfu-grv-cache 2022-01-20 16:17:20 -05:00
Renxuan Wang e642b2f5bc Address comments. 2022-01-18 14:34:18 -08:00
Renxuan Wang 28832a99d6 Address comment. 2022-01-18 14:34:18 -08:00
Renxuan Wang b8bab06e16 Add the functions to set and get mock DNS.
These functions will be used in restarting tests, where mock DNS needs to be saved to and read from files.
2022-01-18 14:34:18 -08:00
Andrew Noyes 28971c5181 Fix memory leak. Closes #4482 2021-12-22 15:04:00 -08:00
Josh Slocum b0aea91895 Broadening explicit disconnect handling to explicit error handling of all types 2021-12-21 14:12:09 -06:00
Andrew Noyes 23de546586 Only build libcoro if COROUTINE_IMPL == libcoro
It doesn't build at all on mac m1
2021-12-03 16:34:35 -08:00
sfc-gh-tclinkenbeard ec64890ac1 Remove some usages of PRId64 by using fmt library 2021-11-30 23:35:36 -08:00
Andrew Noyes b6fd402a3c Add option to use boost or libcoro
By default, use boost everywhere except windows and linux x86 (for
performance reasons)
2021-11-29 13:14:15 -08:00
Renxuan Wang 46d17d748f Change member variable fromHostname to type bool.
So that it can be serialized.
2021-11-23 14:25:02 -10:00
Evan Tschannen 37c9a1320c added --print_sim_time to print simulated time to stdout 2021-11-23 15:01:44 -08:00
Evan Tschannen 6d9f134bf0 fix: merge needs to update on empty versions to release other mutations blocked by the empty version 2021-11-23 15:01:44 -08:00
Mohamed Oulmahdi fe98f1ea56 Add missing bind header for Windows (boost/bind/bind.hpp) 2021-11-22 15:50:32 +01:00
Jon Fu 3f24128da4 Merge branch 'master' of github.com:apple/foundationdb into jfu-grv-cache 2021-11-19 14:46:55 -05:00
Renxuan Wang 22e34bd6b9 Replace <boost/bind.hpp> with <boost/bind/bind.hpp>.
This eliminates many useless warnings when compiling.
`#pragma message: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated. Please use <boost/bind/bind.hpp> + using namespace boost::placeholders, or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.`
2021-11-18 14:00:13 -08:00
Steve Atherton 035e0d6e52
Merge branch 'master' into bit-flipping-workload 2021-11-16 14:42:22 -08:00
Renxuan Wang 4630b0ccea Move DNS mock from SimExternalConnection to Sim2.
This is a revise PR of #5934. In simulation, we don't have direct access to SimExternalConnection.
2021-11-15 17:02:51 -08:00
Steve Atherton 508429f30d
Redwood chunked file growth and low priority IO starvation prevention (#5936)
* Redwood files now growth in large page chunks controlled by a knob to reduce truncate() calls for expansion.   PriorityMultiLock has limit on consecutive same-priority lock release.  Increased Redwood max priority level to 3 for more separation at higher BTree levels.

* Simulation fix, don't mark certain IO timeout errors as injected unless the simulated process has been set to have an unreliable disk.

* Pager writes now truncate gradually upward, one chunk at a time, in response to writes, which wait on only the necessary truncate operations.   Increased buggified chunk size because truncate can be very slow in simulation.

* In simulation, ioTimeoutError() and ioDegradedOrTimeoutError() will wait until at least the target timeout interval past the point when simulation is sped up.

* PriorityMultiLock::toString() prints more info and is now public.

* Added queued time to PriorityMultiLock.

* Bug fix to handle when speedUpSimulation changes later than the configured time.

* Refactored mutation application in leaf nodes to do fewer comparisons and do in place value updates if the new value is the same size as the old value.

* Renamed updatingInPlace to updatingDeltaTree for clarity.  Inlined switchToLinearMerge() since it is only used in one place.

* Updated extendToCover to be more clear by passing in the old extension future as a parameter.  Fixed initialization warning.
2021-11-12 13:47:07 -08:00
Steve Atherton e752fdd69f
Optimization in FlowTransport's use of XXHash to avoid a malloc() when using the stream API and to not use the stream API when a message being sent is contiguous within a single packet buffer block. (#5970) 2021-11-12 11:45:21 -08:00
Renxuan Wang d9965e0e5a Add DNS mock in SimExternalConnection.
This is a substep in supporting hostnames in cluster files. So that in simulation, we can add <hostname, ip addresses> mappings to mock DNS.
2021-11-11 17:05:05 -08:00
Markus Pilman a246c1555d
Merge pull request #5931 from sfc-gh-mpilman/features/all-unit-tests-in-ci
Make sure unit tests are run often enough
2021-11-10 08:41:04 -07:00
Tao Lin fdb3b72e35 Introduce GetRangeAndFlatMap to push computations down to FDB
Re-introduce #5609
2021-11-09 13:52:28 -08:00
negoyal 8fac798ece Fix a memory bug. 2021-11-09 10:32:17 -08:00
Markus Pilman 7df059570a Make sure unit tests are run often enough 2021-11-08 15:43:32 -07:00
sfc-gh-tclinkenbeard e4ca7e9511 Fix comment for RequestStream::tryGetReply 2021-11-04 12:59:50 -07:00
Renxuan Wang f15ceb5489 Add Hostname struct, and fromHostname in NetworkAddress struct. 2021-11-04 11:42:28 -07:00
Tao Lin 586cc3b102
Revert "Introduce GetRangeAndFlatMap to push computations down to FDB" 2021-11-04 08:46:56 -07:00
Tao Lin 6c98e35893 Rename Hop to FlatMap 2021-11-03 13:32:01 -07:00
Tao Lin 0853661d13 Introduce getRangeAndHop to push computations down to FDB 2021-11-03 13:21:16 -07:00
Steve Atherton dc3f46c2ae Change asserts to throw internal_error as these function calls should never be compiled out. 2021-11-03 11:00:12 -07:00
Steve Atherton f3d62ce002 Assert success on XXHash stream functions. 2021-11-02 23:40:53 -07:00
Steve Atherton 313a3dcd63 Change FlowTransport to use 64 bit XXHash instead of CRC32. 2021-11-02 23:16:03 -07:00
sfc-gh-tclinkenbeard d0c9cf4fb0 Enable mismatched-tags clang warning 2021-11-01 14:18:31 -07:00