9056 Commits

Author SHA1 Message Date
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
Zhe Wang
37054af7e2
Fix RocksDB Metrics (#6803)
* fix-metrics-in-rocksdb

* remain-GetIntProperty-for-checkRocksdbState

Co-authored-by: Zhe Wang <zhewang@Zhes-MacBook-Pro.local>
2022-04-08 17:07:22 -04: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
62975f87d1 Formatting 2022-04-08 15:04:46 -04:00
sfc-gh-tclinkenbeard
41c3bb03c3 Fix storageFaultTolerance calculation 2022-04-08 11:35:24 -07: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
sfc-gh-tclinkenbeard
e3acbd1388 Fix bug in getStorageWorkers 2022-04-08 11:21:29 -07:00
Xiaoxi Wang
1eb1cff45b
Merge pull request #6806 from sfc-gh-xwang/fix-conf-restart
Enforce storage migration compatible config in restarting test
2022-04-08 11:15:31 -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
sfc-gh-tclinkenbeard
3fcaf4dda3 Account for storage team size when computing storageFaultTolerance 2022-04-08 10:39:44 -07:00
Dan Lambright
5bdc525353
Merge branch 'main' into vv 2022-04-08 13:16:04 -04:00
Steve Atherton
6af2b83bc6 Updated BTree write-only forensic fields for last known logical page ID and last known logical parent page ID.
Also simplified multipage update loops which were using an unnecessary temp variable left from a prior implementation involving remapping.
2022-04-08 01:17:50 -07:00
Xiaoxi Wang
74d81f90e1 enforce storage migration random config 2022-04-08 00:28:05 -07:00
Steve Atherton
83b22f9829 Restore random storage engine selection to prepare for PR merge. 2022-04-07 23:54:59 -07:00
Steve Atherton
1941c9ac3b Bug fix, empty root was written with the wrong capacity so inserts later could buffer overflow and be missing from the page. 2022-04-07 23:52:37 -07:00
sfc-gh-tclinkenbeard
e27b0d9ab5 Merge remote-tracking branch 'origin/main' into improve-snapshot-fault-tolerance 2022-04-07 23:30:16 -07:00
sfc-gh-tclinkenbeard
f4a988fe36 Remove unnecessary call to getDatabaseConfiguration in ddSnapCreateCore 2022-04-07 23:27:59 -07:00
sfc-gh-tclinkenbeard
91930b8040 Remove getMinReplicasRemaining PromiseStream.
Instead, in order to enforce the maximum fault tolerance for snapshots,
update getStorageWorkers to return the number of unavailable storage
servers (instead of throwing an error when unavailable storage servers
exist).
2022-04-07 23:23:23 -07:00
Steve Atherton
702bd59ded Clear unused memory regions for structures written to disk. 2022-04-07 23:02:33 -07:00
Steve Atherton
3ef18bc173 Rename Page and VersionHeader to PageHeader for consistency. Check for known encrypted types explicitly in isEncodingTypeEncrypted(). Make writePhysicalBlock() hold a Page reference which is simpler and more robust. Remove unused argument in switchTree(). 2022-04-07 20:59:34 -07:00
Zhe Wu
4ff4e3b826 address comments 2022-04-07 17:34:13 -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
Xiaoxi Wang
4eb0adc51c
Merge pull request #6776 from sfc-gh-xwang/fix-snap-test-assertion
Check pseudo locality before pop
2022-04-07 10:45:22 -07:00
Xiaoxi Wang
d25fc4db34 add ASSERT_WE_THINK 2022-04-07 09:21:50 -07:00
Zhe Wang
3d325940ad
Fix data race issue when multithreaded RocksDB store using histogram (#6766)
* using-ThreadReturnPromiseStream-to-make-histogram-thread-safe

* address-comment-and-verify-functionality-in-cluster

* remove-old-histogram-metrics

* fix-comment

Co-authored-by: Zhe Wang <zhewang@Zhes-MacBook-Pro.local>
2022-04-07 00:31:36 -04: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
Chaoguang Lin
f62904187e Disable remote kvs if RocksDB is used 2022-04-06 17:44:20 -07:00
Steve Atherton
f7ba78ca97 Fixed typo, remove throw argument to follow best practice, change wrong format warn to warnAlways. 2022-04-06 14:51:01 -07:00
Steve Atherton
a51b1c9d98 Remove checks for transaction_too_old because Redwood no longer generates this error. 2022-04-06 14:41: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
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
Xiaoxi Wang
20fee3dd06 check pseudo locality before pop 2022-04-05 23:48:18 -07:00
Steve Atherton
8e9a7811bf Redwood debug improvements to filter and direct output more easily. 2022-04-05 23:33:40 -07: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
Steve Atherton
6546d04f2d Removed BUGGIFY() usage on hot path since it involves a string copy, and made buggified behavior happen more often in simulation which should increase edge case coverage. 2022-04-05 15:05:02 -07: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
Evan Tschannen
c168840b54 blob workers properly destroy change feeds when they are no longer needed 2022-04-05 11:02:32 -05:00
Dan Lambright
60c55e0785 Merge remote-tracking branch 'origin/version-vector-prototype' into vv 2022-04-05 11:17:39 -04:00
Steve Atherton
13d3391d30 In simulation, sometimes use redwood destructive sanity check in KeyValueStoreRedwood disposal for more test coverage. 2022-04-05 02:10:31 -07:00
Jingyu Zhou
f68fd28d73 Refactor duplicated code into IKnobCollection::setupKnobs() 2022-04-05 02:06:38 -07:00
Steve Atherton
6c8eca061a In redwood unit test, only reopen the btree prior to the destructive sanity check half the time. 2022-04-04 19:29:32 -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
Chaoguang Lin
c8455237ea Fix the bug where use the pointer after it's cleaned 2022-04-04 11:49:41 -07:00
Xiaoge Su
6b69c439f0 Allowing globally knob change in TOML file based test
In commit 99b030c2f63a3c9ad92ed56aa2b5709322a4cb06, it is allowed to set
knob values in TOML file per single test, using syntax

[[test]]
    [[test.knobs]]
    knob_key = knob_value

the knob key/value pairs are changed before the TEST_CASE starts, then
reverted after TEST_CASE completes.

With this patch, it is possible to *globally* update the knob value,
i.e.

[[knobs]]
enable_encryption = true

[[test]]
testTitle = 'EncryptKeyProxy'

    [[test.workload]]
    testName = 'EncryptKeyProxyTest'

This is manually tested by printing out knob key/value pairs. Also
tested using Ata's EncryptKeyProxy test code by enabling
enable_encryption key.
2022-04-04 11:17:32 -07:00