Commit Graph

365 Commits

Author SHA1 Message Date
Sreenath Bodagala f038f37513 - Do not invoke version vector related code on the sequencer and
GRVs when version vector feature is disabled.
2022-04-12 20:05:32 +00:00
Dan Lambright 1b3b4166c6
Merge branch 'main' into vv 2022-04-08 17:18:13 -04: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
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
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
Jingyu Zhou 0c88be0393 Refactor resolution balancing into separate files 2022-03-23 09:57:31 -07:00
Jingyu Zhou 437e7d27c6 Use trigger to start resolutionBalancing
Trigger when there are more than one resolvers. This also avoids the problem of
receiving multiple UpdateRecoveryDataRequests.
2022-03-23 09:57:31 -07:00
Jingyu Zhou 6e8d16538d Remove an unused variable from MasterData 2022-03-23 09:57:31 -07:00
Jingyu Zhou 7736ea87b0 Fix code format 2022-03-23 09:57:31 -07:00
Jingyu Zhou 213e37191c Add code coverage macro for resolution balancing 2022-03-23 09:57:31 -07:00
Jingyu Zhou 3379f1e974 Move resolutionBalancing() back to master
This revert the behavior done by a recent refactor on master recovery in PR #6191.
2022-03-23 09:57:31 -07:00
sfc-gh-tclinkenbeard a71099471b Update copyright header dates 2022-03-21 13:36:23 -07:00
Jingyu Zhou 415970a47b Fix compiler warnings
Initialization order issue.
2022-02-07 11:49:56 -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
Dan Lambright 9544379cdf rebase 2022-01-20 11:12:33 -05:00
Ata E Husain Bohra 936bf5336a
Revert "Revert "Refactor: ClusterController driving cluster-recovery state machine" (#6191)
* Revert "Revert "Refactor: ClusterController driving cluster-recovery state machine""

Major changes includes:
1. Re-revert Sequencer refactor commits listed below (in listed order):
1.a. This reverts commit bb17e194d9.
1.b. This reverts commit d174bb2e06.
1.c. This reverts commit 30b05b469c.

2. Update Status.actor to track ClusterController interface to track
   recovery status.
3. Introduce a ServerKnob to define "cluster recovery trace event"
   prefix; for now keeping it as "Master", however, it should allow
   smooth transition to "Cluster" prefix as it seems more appropriate.
2022-01-06 12:15:51 -08:00
Aaron Molitor 30b05b469c Revert "Refactor: ClusterController driving cluster-recovery state machine"
This reverts commit dfe9d184ff.
2021-12-24 11:25:51 -08:00
Ata E Husain Bohra dfe9d184ff Refactor: ClusterController driving cluster-recovery state machine
At present, cluster recovery process consists of following steps:
1. ClusterController clusterWatchDatabase actor recruits
   master/sequencer process.
2. Sequencer process implements the cluster recovery state machine,
   responsible to recruit all other processes as well restore the
   cluster state.

Patch proposes a scheme where the cluster recovery state machine
is implemented and driven by the ClusterController process instead
of the Sequencer process.

Advantages of the scheme could be:
1. Simplified design where ClusterController recruits "sequencer"
   process like other worker processes compared to current scheme
   where "sequencer" process gets special treatment. In newer scheme
   sequencer is responsible for maintaining/providing
   "committed version" (as expected).
2. ClusterController is responsible for worker processes recruitment,
   the sequencer though orchestrating the recovery state machine, it
   need to reachout to the ClusterController for recruiting worker
   processes etc.

NOTE:
Patch has moved the recovery state machine code from
'sequencer' -> 'cluster-controller' process, however, necessary
updates were done for both functionality as well as performance
improvement reasons.

Next Steps:
Cluster recovery documentation will be updated in near future.
2021-12-22 14:06:27 -08:00
A.J. Beamon f29f487823
Unify flags (#25)
* Unify flags implementation and change help text in backup.actor.cpp
Description

Testing

* Keep LOG_GROUP unchanged

Description

Testing

* Transfer the hyphens to underscores for internal options and user's input, EXCEPT leading hyphens

Description

Testing

* Use a deep copy of the user's input flag to do the match

Description

Testing

* Convert the _ to - in Option arrays of backup.actor.cpp

Description

Testing

* Transter _ to - for files:
        TLSConfig.actor.h, fdbcli.actor.cpp, fdbserver.actor.cpp, FileConverter.h, FileConverter.cpp

Description

Testing

* Change another way to unify flag: using SO_O_ICASE_HYPHEN_AND_UNDERSCORE to determine whether we do the conversion in function IsEqual

Description

Testing

* Change the config command's name from SO_O_ICASE_HYPHEN_AND_UNDERSCORE to SO_O_HYPHEN_TO_UNDERSCORE

Description

Testing

* Update the comment for the SO_O_HYPHEN_TO_UNDERSCORE

Description

Testing

* Fix left underscore in SOption arrays

Description

Testing

* Convert _ to - in several files for commands

Description

Testing

* Make the FDBService and fdbmonitor backward compatible

Description

Testing

* Fix bugs about pointers

Description

Testing

* Check underscore and hyphen at the same time for --knob_, --localily_ and --test_
And fix bugs in fdbmonitor and FDBService
Description

Testing

* Simplify the function in fdbmonitor and FDBService about retrieving arguments.
And fix some documents in masterserver.actor.cpp

Description

Testing

* Convert _ to - for knob in the setKnob functions

Description

Testing

* Convert - to _ in the setKnob functions

Description
Since key in the knob related maps only contain _

Testing

* Rename varialbe name in the fdbmonitor and FDBService for clarification

Description

Testing

Co-authored-by: Chang Liu <chang.liu@snowflake.com>
2021-12-14 08:44:39 -08:00
Dan Lambright 0222d8669d fix simulation failures 2021-12-10 09:56:21 -05:00
A.J. Beamon 72c5fb183d Fix: avoid updating the master registration while the cstate is written but we are not accepting commits. 2021-11-30 15:44:04 -08:00
Jon Fu 3f24128da4 Merge branch 'master' of github.com:apple/foundationdb into jfu-grv-cache 2021-11-19 14:46:55 -05:00
Lukas Joswiak 74cf64fe0f Sync cluster ID through ServerDBInfo 2021-11-09 12:29:48 -08:00
Lukas Joswiak 30867750b5 Add protection against storage and tlog data deletion when joining a new cluster 2021-11-09 12:29:47 -08:00
Sreenath Bodagala 6931f9ed46 - Capture metrics related to waitForPrev 2021-11-05 21:30:15 +00:00
Dan Lambright befe1993c4 fix conflict on rebase 2021-10-29 12:25:26 -04:00
Sreenath Bodagala 8a1137d572 - Address a review comment 2021-10-28 22:48:35 +00:00
Sreenath Bodagala 4503b0a347 - Capture metrics about empty/non-empty peeks done by storage servers 2021-10-26 14:37:46 +00:00
A.J. Beamon e882eb33fc Abstract the cluster file into a cluster connection record that can be backed by something other than the filesystem. 2021-10-22 11:05:18 -07:00
sbodagala 48a0ecd647
Merge pull request #5787 from dlambrig/integrate-PR5700
version vector / Calculate TPCV on resolvers
2021-10-20 16:35:44 -04:00
Jingyu Zhou 44fe89333b Fix version vector not updated on master role 2021-10-18 17:18:18 -07:00
Jingyu Zhou 44943d3866 Fix initialization order 2021-10-18 16:47:36 -07:00
Sreenath Bodagala 246f035afe Merge remote-tracking branch 'apple-upstream/master' into version-vector-prototype 2021-10-18 19:07:33 +00:00
Dan Lambright 23062b892e Calculate tpcv on resolvers 2021-10-15 16:40:00 -04:00
Dan Lambright 99f0eb369d
Merge pull request #5726 from dlambrig/counters
stats on version vector size
2021-10-15 14:44:12 -04:00
Dan Lambright dbbda24879 Address review comments 2021-10-15 12:17:39 -04:00
Dan Lambright 212e32a600 stats on version vector size 2021-10-15 11:39:35 -04:00
Jingyu Zhou 0a88d6a94c Limit resolution balancing to normal keys
This is for resolver private mutation feature if used.
2021-10-15 09:47:23 -04:00
Jingyu Zhou b47da4f2ea Limit resolution balancing to normal keys
When using resolver generated private mutations, all resolvers must process all
metadata mutations. So there is no point of load balancing among resolvers for
the system, i.e., \xff keyspace.
2021-10-15 09:47:23 -04:00
Jingyu Zhou 0dc9c607f4 Add knob PROXY_USE_RESOLVER_PRIVATE_MUTATIONS
To control proxy to use private mutations from resolvers or not.
2021-10-15 09:47:23 -04:00
Jingyu Zhou 5e6fa0737a Master broadcasts txnStateStore to Resolvers 2021-10-15 09:45:13 -04:00
Markus Pilman 424b35de63 verify FLAG_USE_PROVISIONAL_PROXIES on the server 2021-10-09 16:40:24 -06:00
Dan Lambright f68d018a06 conflicts 2021-10-08 12:39:39 -04:00
Jon Fu 4c942cc4e3 simplify sim_validation verification to only involve maximum bound 2021-10-06 14:28:04 -04:00
Jon Fu 9a18cc8f41 Change debug time bound update logic to be located in masterserver 2021-10-05 17:31:31 -04:00
Dan Lambright 58e1888d8e remove network hop by getting previous commit versions in GetCommitVersionRequest 2021-09-30 11:51:57 -04:00
Chang Liu 5da864d91c Fix roll trace event issue
Description

Testing
2021-09-24 09:53:32 -07:00
Chang Liu 8427e40cbe Fix roll trace event issue
Description

Testing
2021-09-24 09:53:32 -07:00
Chang Liu 48990058a3 Fix roll trace event issue
Description

Testing
2021-09-24 09:53:32 -07:00
Sreenath Bodagala 2aa3b44d4e Merge remote-tracking branch 'apple-upstream/master' into version-vector-prototype
- Conflicts:
	fdbserver/LogSystem.h
	fdbserver/LogSystemConfig.h
	fdbserver/TagPartitionedLogSystem.actor.cpp

- Files modified during merge:

modified:   fdbserver/LogSystem.cpp
modified:   fdbserver/LogSystemConfig.cpp
2021-09-17 19:36:18 +00:00