Commit Graph

1239 Commits

Author SHA1 Message Date
Alex Miller e70e59a895 Change some file locations. 2018-12-13 14:53:19 -08:00
Markus Pilman dce290909d fdbserver now compiling 2018-12-13 14:13:47 -08:00
Evan Tschannen d9626895b1
Merge pull request #964 from xumengpanda/mengxu/teamcollection-release
TeamCollection: Use machine teams to create server teams to increase availability at scale when a machine has multiple servers
2018-12-13 13:18:54 -08:00
Meng Xu 79d94f78f1 TeamCollection: Improve code efficiency
Further improve code efficiency by

1) Avoid rebuild machine locality map when machine locality is changed.
This may leave the global machine locality map stale.
This is ok as long as we do not use the global map to validate
the machine team follows the locality policy.

2) Use ASSERT_WE_THINK instead of ASSERT to avoid runtime overhead.
ASSERT_WE_THINK will only validate the condition in simulation mode.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-12 22:38:38 -08:00
Meng Xu e197926c80 TeamCollection: Remove a duplicate function
Remove a duplicate function that has different signature.
No functionality change.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-12 15:21:37 -08:00
Meng Xu ad7040efcd TeamCollection: Bug fix in handle server locality change
Make sure the link between server and machine is updated
in both server and machine.
Rename function name to better reflect its functionality.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-12 14:03:29 -08:00
Meng Xu e069b5c31c TeamCollection: Use clang format
No functional change.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-06 11:39:35 -08:00
Meng Xu 5d47b9c884 TeamCollection: Handle server locality change
A server locality may change from one machine to another.
This affects the old machine and machine team the server is on, and
the new machine the server moves to.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-05 22:23:14 -08:00
Meng Xu c5047bc8c3 TeamCollection: All machine teams are correct size
We only create correct size machine teams.
When configuration (e.g., team size) is changed,
the DDTeamCollection will be destroyed and rebuilt
so that the invariant will not be violated.

Based on the invariant, we can count the number of
machine teams more quickly.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-05 15:09:38 -08:00
Meng Xu 57eab1f283 DataDistribution: Remove addAllTeams function
The addAllTeams function can be replaced with the new addTeamsBestOf
function by passing a large enough number of teams to build.
Remove addAllTeams function and update the related unit tests.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-05 15:03:16 -08:00
Meng Xu 38c5c2562b DataDistribution: Update NotEnoughServers unit test
The buggify option may set 1 to the knob parameters
(DESIRED_TEAMS_PER_SERVER and MAX_TEAMS_PER_SERVER).
When this happens, the number of machine teams to build will be
less than what we want, which prevents us from building enough
server teams.

To avoid this problem, we build machine teams before
we call addTeamsBestOf to build server teams.

We also add the ASSERT to ensure we build enough machine teams and
server teams in the test case.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-05 14:36:48 -08:00
Meng Xu f32c04c834 DataDistribution: Update NotEnoughServers unit test
Change the test condition for the NotEnoughServers unit test.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-03 23:14:01 -08:00
Meng Xu 54a4d6b308 TeamCollection: Improve code efficiency
Improve code efficiency with the following changes:
1) Change always-true if-statement to ASSERT;
2) Return when we are confident we will not find more machine teams.

No functionality change.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-01 17:10:50 -08:00
Meng Xu 8d6c6e000b DataDistribution: Mute the NotEnoughServers test
Due to the randomness in choosing a server, we cannot gurantee to
find all teams. The NotEnoughServers test case may create false positive
bug report in the correctness test.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-01 13:29:45 -08:00
Meng Xu 68dcec2240 DataDistribution: Change a unit test
Try multiple times of addTeamsBestOf() when we cannot find an available team
due to the pure randomness in choosing the server teams.

The changes for the unit test reduces the false positive in the simulation test results.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-01 13:12:55 -08:00
Meng Xu a43f579f66 TeamCollection: Change 1 unit test
Relax the assert condition on the random unit test.
Due to the randomness in choosing the machine team and
the server team from the machine team, it is possible that
we may not find the remaining several (e.g., 1 or 2) available teams.
For example, there are at most 10 teams available, and we have found
9 teams, the chance of finding the last one is low
when we do pure random selection.

It is ok to not find every available team because
1) In reality, we only create a small fraction of available teams, and
2) In practical system, this situation only happens when most of servers
   are *temporarily* unhealthy. When this situation happens, we will
   abandon all existing teams and restart the build team from scratch.

In simulation test, the situation happens 100 times out of 128613 test cases
when we run RandomUnitTests.txt only.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-12-01 13:11:19 -08:00
Meng Xu f311455c45 TeamCollection: Cleanup code and add checks
Remove unnecessary sanity checks and remove the dead code.
Add some necessary sanity checks.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-30 17:40:21 -08:00
Meng Xu ea3bd1502d TeamCollection: Calculate machine team number
Calculate the number of machine teams in the same way
as we calculate the number of server teams.

Only count the machine teams that has the correct size and is healthy.

Simplify code by removing unnecessary check.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-29 15:38:23 -08:00
Meng Xu 2b41ad5e57 TeamCollection: Pick server team randomly
Pick server team purely randomly instead of picking the least used one.
This is to avoid creating correlation in the server teams we pick when
new machines are added.

The logic is:
First pick the one random least used server as chosen server;
Then pick a machine team that has the server;
Then pick a server on each machine in the machine team.
We make sure the chosen server is picked.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-28 15:57:53 -08:00
Meng Xu e4c9d4cbae TeamCollection: Build all machine teams first
Before we build server teams, we build the desired number of machine teams.
Then we pick the least used server, from which we pick the least used machine team.
Then we pick the least used server on each machine in the least used machine team to get the server team.

Note: The logic of building machine teams should be independent from server teams.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-27 18:06:36 -08:00
A.J. Beamon 975711c389 Merge branch 'release-6.0' of github.com:apple/foundationdb
# Conflicts:
#	documentation/sphinx/source/release-notes.rst
2018-11-27 09:50:39 -08:00
Meng Xu 4c2c65c1b3 TeamCollection: Replace TraceEvent with ASSERT
Replace one TraceEvent that never happens in correctness test with an ASSERT.
Change format in one comment.

Signed-off-by: Meng xu <meng_xu@apple.com>
2018-11-27 09:48:24 -08:00
Evan Tschannen 530b5e3763 fix: do not track txsPopVersions unless there are remote logs to pop from 2018-11-26 15:17:17 -08:00
Evan Tschannen 512c00d304 added dump token trace events for storage server interfaces after rollbacks 2018-11-26 11:01:10 -08:00
Meng Xu 5cbff740ca TeamCollection: Add ASSERT
Remove sanity check code for performance benefit.
Replace TraceEvent(SevError) with ASSERT.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-21 13:16:52 -08:00
Meng Xu 8de031f9a6 TeamCollection: clang-format
Format the changes with git clang-format.
No functional changes.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-21 11:18:26 -08:00
Meng Xu 12c3bec968 TeamCollection: Misc changes to resolve review comments
No functional change.
Report error in TraceEvent when invariant is violated.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-19 20:44:52 -08:00
Meng Xu 52c6a66601 TeamCollection: Fix a bug introduced in code review
When we GetTeam, the data distribution actor may have zero teams in
rare situation in the ConfigureTest.txt test.
We should return an empty team in this situation instead of triggering error.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-16 16:34:38 -08:00
Meng Xu f7a7e069f0 TeamCollection: Remove unnecessary comments
Pass 41806 tests with no failure

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-16 15:56:35 -08:00
Meng Xu 73c58852f0 TeamCollection: Resolve code review comments
Resolve code review comments:
1) Improve the code efficiency by avoiding unnecessary map search
   and avoiding unnecessary checking
2) Remove or comment out trace events when they can be spammy
3) Improve coding style

Tested for 1 hour and no error was found.
KillRegionCycle.txt test was excluded from the test because
existing code cannot pass that test either

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-16 15:55:33 -08:00
Meng Xu 5051b35c61 TeamCollection: Use machine team to create server team
Current server team collection logic does not consider
the fact that multipe storage servers can run on the same machine.
When multiple machines fail, all servers on the machines will fail, and
the possibility of having one process team fail and lose data is very high.

To reduce the possibility of losing data when multiple machine fails,
we first create machine teams which span across different fault zones;
we then create server teams based on machine teams by
first picking 1 machine team, and then
picking 1 server from each machine in the machine team.

Signed-off-by: Meng Xu <meng_xu@apple.com>
2018-11-16 15:53:22 -08:00
Evan Tschannen e45952bc53 Merge branch 'release-6.0'
# Conflicts:
#	documentation/sphinx/source/release-notes.rst
#	fdbclient/BackupContainer.actor.cpp
#	fdbclient/BlobStore.actor.cpp
#	fdbclient/HTTP.actor.cpp
#	tests/BlobStore.txt
#	versions.target
2018-11-13 16:06:39 -08:00
Evan Tschannen 1bd615f954 fix: remoteDcIds will not actually have transaction logs unless usable regions is > 1 2018-11-13 12:36:04 -08:00
Evan Tschannen 4e54690005 Merge branch 'release-6.0'
# Conflicts:
#	fdbserver/DataDistribution.actor.cpp
#	fdbserver/MoveKeys.actor.cpp
2018-11-12 20:26:58 -08:00
Evan Tschannen 3f3a562f75 updated resolution balancing knobs to be a little more aggressive 2018-11-12 19:11:28 -08:00
Evan Tschannen 239bf882d8 Merge branch 'release-6.0' into feature-resolution-balancing-fix 2018-11-12 18:43:20 -08:00
Evan Tschannen 3f461f3706 updated comments 2018-11-12 18:42:29 -08:00
Evan Tschannen 6353a6724b strengthened the protections related to changing regions 2018-11-12 17:40:40 -08:00
Evan Tschannen 26c49f21be fix: we do not know a region is fully replicated until all the initial storage servers have either been heard from or have been removed 2018-11-12 17:39:40 -08:00
Evan Tschannen 3f39024640 buggify resolution balancing so that it still happens in simulation 2018-11-12 00:03:07 -08:00
Evan Tschannen 536ee826da tuned resolver balancing to keep the resolvers within 5MB per second of each other 2018-11-11 23:42:45 -08:00
Evan Tschannen 50f481b149 fix: peek local should not call peek all, because it is possible to still peek from remote log sets after a special tag 2018-11-11 19:16:25 -08:00
Evan Tschannen 7892da032f fix: Do not remove the locality entry for the current transaction logs when removing storage servers
fix: dcId_locality map could be incorrect after restarting recruitEverything
2018-11-11 12:37:53 -08:00
Evan Tschannen cd188a351e fix: if a destination team became unhealthy and then healthy again, it would lower the priority of a move even though the source servers we are moving from are still unhealthy
fix: badTeams were not accounted for when checking priorities
2018-11-11 12:33:31 -08:00
Evan Tschannen 4b5d0b4e2c Merge branch 'release-6.0'
# Conflicts:
#	documentation/sphinx/source/release-notes.rst
#	fdbclient/AsyncFileBlobStore.actor.cpp
#	fdbclient/AsyncFileBlobStore.actor.h
#	fdbclient/BlobStore.actor.cpp
#	fdbclient/BlobStore.h
#	fdbclient/HTTP.actor.cpp
#	fdbclient/ManagementAPI.actor.cpp
#	fdbclient/NativeAPI.actor.cpp
#	fdbrpc/LoadBalance.actor.h
#	fdbrpc/batcher.actor.h
#	fdbrpc/fdbrpc.vcxproj
#	fdbrpc/sim2.actor.cpp
#	fdbserver/DataDistribution.actor.cpp
#	fdbserver/DataDistributionTracker.actor.cpp
#	fdbserver/SimulatedCluster.actor.cpp
#	fdbserver/TLogServer.actor.cpp
#	fdbserver/masterserver.actor.cpp
2018-11-10 13:04:24 -08:00
Evan Tschannen a654183f63
Merge pull request #791 from ajbeamon/remove-cluster-from-iclientapi
Remove cluster from IClientApi (phase 2 of removing DB names)
2018-11-10 10:16:18 -08:00
Evan Tschannen 6a406bae72
Merge pull request #896 from ajbeamon/downgrade-incorrect-cluster-file-event
Downgrade the severity of IncorrectClusterFileContents the first time…
2018-11-10 10:06:36 -08:00
Evan Tschannen 6f4ad84777
Merge pull request #903 from ajbeamon/move-batcher-into-proxy
Move the sort of generic batcher from fdbrpc and make it specific to …
2018-11-10 09:56:03 -08:00
Evan Tschannen 7c23b68501 fix: we need to build teams if a server becomes healthy and it is not already on any teams 2018-11-09 18:06:00 -08:00
A.J. Beamon c3a06aa6f1 Fix indentation 2018-11-09 14:25:40 -08:00
A.J. Beamon 67a152ae9f Move the sort of generic batcher from fdbrpc and make it specific to batching commits in master proxy. Also a couple minor formatting changes. 2018-11-09 14:19:18 -08:00
Evan Tschannen 3e2484baf7 fix: a team tracker could downgrade the priority of a relocation issued by the team tracker for the other region 2018-11-09 10:07:55 -08:00
Evan Tschannen 6874e379fc fix: set the simulator’s view of usable regions to one during configure tests which can disable usable regions 2018-11-09 10:06:03 -08:00
Evan Tschannen 19ae063b66 fix: storage servers need to be rebooted when increasing replication so that clients become aware that new options are available 2018-11-08 15:44:03 -08:00
Evan Tschannen 1cf5689d62 fix: workers could only create a shared transaction log for one store type. This resulted in the old store type being used for new transaction logs after configuration changes which changed the store type 2018-11-07 21:09:51 -08:00
Evan Tschannen 599cc6260e fix: data distribution who not always add all subsets of emergency teams
fix: data distribution would not stop tracking bad teams after all their data was moved to other teams
fix: data distribution did not probably handle a server changing locality such that the teams it used to be on no longer satisfy the policy
2018-11-07 21:05:31 -08:00
Stephen Atherton ade75ac692 Merge branch 'master' of github.com:apple/foundationdb into feature-redwood
# Conflicts:
#	fdbserver/worker.actor.cpp
2018-11-07 11:43:54 -08:00
Stephen Atherton 9d73166b3b Many bug fixes related to concurrent page operations and pager shutdown. 2018-11-06 19:31:16 -08:00
Evan Tschannen 6bb283aebc fix: dcId to Locality changes could be lost if an emergency transaction happened that did not change the configuration
fix: master proxy was starting dcId’s at 1 number too large
2018-11-05 11:12:43 -08:00
Evan Tschannen 04fa2a7202 fix: we could recover in a region with priority < 0 2018-11-05 10:14:26 -08:00
A.J. Beamon 187e507e53 Downgrade the severity of IncorrectClusterFileContents the first time it is logged to avoid transient issues that appear like the cluster file hasn't been updated (e.g. the cluster file is shared between multiple processes). 2018-11-05 09:28:08 -08:00
Evan Tschannen 87295cc263 suppressed spammy trace events, and avoid reporting a long master recovery duration when the cluster is first created 2018-11-04 23:07:56 -08:00
Evan Tschannen 87d0b4c294 fix: the remote region does not have a full replica is usable_regions==1 2018-11-04 22:05:37 -08:00
Evan Tschannen c1bd279a4e addressed review comments 2018-11-04 20:26:23 -08:00
Evan Tschannen bd60027544 test region priority changes 2018-11-04 20:11:23 -08:00
Evan Tschannen c02690471d added protection against configuration changes which cannot be immediately reverted
the configure database workload tests region configurations
2018-11-04 19:53:55 -08:00
Evan Tschannen 3304c83229 added additional checks in peek which determine when a tag will never get additional versions 2018-11-04 19:28:15 -08:00
Evan Tschannen accba4fa1d keep track of the last time a process became available to set a better starting value for remoteStartTime 2018-11-04 14:33:03 -08:00
Evan Tschannen 45c8f2dfcb restarting tests will sometimes configure to a fearless configuration on startup if possible 2018-11-02 14:16:47 -07:00
Evan Tschannen 2a8c628d82 fix: even if a peek cursor cannot find a local set for the most recent data, it still may be able to find data from older log sets 2018-11-02 14:13:57 -07:00
Evan Tschannen f045c041eb fix: if a storage server already exists in a remote region after converting to fearless, it did not receive mutations between the known committed version and the recovery version 2018-11-02 14:11:39 -07:00
Evan Tschannen bf6545a9cf clients cache storage server interfaces individually, instead of as a team. This is needed because in fearless every shard has storage servers from two separate teams, leading to a lot of possible combinations
allAlternatives failed logic was simplified, because we are already doing a global rate limiting, so a per shard limit is unnecessary
reduced unnecessary state variables in waitMetrics requests
2018-11-02 13:15:09 -07:00
Evan Tschannen 3b97f5a899 fix: the storage server still has to pop old tags, even if it does not need any data from them 2018-11-02 13:10:14 -07:00
Evan Tschannen 979597a2ca fix: upgraded tags must be popped from all log sets 2018-11-02 13:09:18 -07:00
Evan Tschannen 1b5d28386a fix: the Tlog would not update the durable version properly when version_sizes was empty 2018-11-02 13:05:54 -07:00
Evan Tschannen 2d9a670774 fix: nested multCursors would improperly hang on getMore, because an inner pop of cursors would not be detected by the outer instance 2018-11-02 13:04:09 -07:00
Evan Tschannen e68c07ae35 fix: trackShardBytes was called with the incorrect range, resulting in incorrect shard sizes
reduced the size of shard tracker actors by removing unnecessary state variable. Because we have a large number of these actors these extra state variables add up to a lot of memory
2018-11-02 13:03:01 -07:00
Evan Tschannen ad98acf795 fix: if the team started unhealthy and initialFailureReactionDelay was ready, we would not send relocations to the queue
print wrong shard size team messages in simulation
2018-11-02 13:00:15 -07:00
Evan Tschannen 1d591acd0a removed the countHealthyTeams check, because it was incorrect if it triggered during the wait(yield()) at the top of team tracker 2018-11-02 12:58:16 -07:00
Evan Tschannen 30fbc29af1 Renamed TimeKeeperStarted to TimeKeeperCommit 2018-11-02 12:57:03 -07:00
Evan Tschannen 278dbd5096 call debug transaction on timekeeper 2018-11-02 12:56:29 -07:00
Stephen Atherton df3bdde50b Many bug fixes. AsyncFileCached write() on a page with a zero-copy read in progress would orphan the old page before the read was finished. Pager file operations were not converting page id to int64 for byte offset calculation. Pager was not calling releaseZeroCopy() after readZeroCopy() if there was an error or cancellation. Pager reads were using some variables that could go out of scope. BusyPage's mechanism for notifying when a physical page is no longer in use is itself no longer in use and therefore removed. Pager shutdown now cancels all outstanding reads. Improved some debug output. 2018-10-31 02:14:55 -07:00
Stephen Atherton b08497b7ea Bug fix, at least some users of IKeyValueStore expect the read actors to make their own copies of key arguments. 2018-10-25 19:48:31 -07:00
Stephen Atherton 0277dab747 Removed accidental config change. 2018-10-25 04:01:42 -07:00
Stephen Atherton 342466817a Added pagefile name to debug output. Shutdown will no longer throw if actor collection or delete futures have errors. 2018-10-25 04:00:02 -07:00
Stephen Atherton 0e84c1f438 Pager and btree debug output macro now prints local network address and time. 2018-10-25 03:57:09 -07:00
Stephen Atherton 32b43cc02b Added 'simple' flag in simulation config generation. Defaults to false, must be changed in code. 2018-10-25 01:25:41 -07:00
Stephen Atherton 93501947f8 Process_behind should also be sent to clients. 2018-10-24 20:38:15 -07:00
Stephen Atherton f17cc1e20f StorageServer will no longer send io_error or other inappropriate errors to a client (this would never happen on SQLite). Many bug fixes around error handling, initialization, and shutdown in Redwood. StorageServer now calls init() on its underlying storage engine. 2018-10-24 15:57:06 -07:00
Alex Miller a074dc2a60 Revert one line from #856 that accidentally changed the include path for Windows.h 2018-10-23 18:58:00 -07:00
Evan Tschannen 6bb2ba5d92 Merge commit '2a34115e65639b7aad368a148de3c4189bc34bfc'
# Conflicts:
#	fdbserver/storageserver.actor.cpp
#	fdbserver/worker.actor.cpp
2018-10-23 17:05:42 -07:00
Evan Tschannen a123c9c533 forgot to commit as part of the merge 2018-10-23 16:53:41 -07:00
Evan Tschannen 7e215b7e0c Merge branch 'release-6.0' of github.com:apple/foundationdb into release-6.0
# Conflicts:
#	fdbserver/worker.actor.cpp
2018-10-23 16:53:07 -07:00
Alex Miller 6bb1f4093d
Merge pull request #856 from dropbox/pr/include-fix
Adjust all includes to be relative to the root.
2018-10-22 09:51:55 -07:00
Clement Pang 3a30621071
Merge branch 'release-6.0' into memory-fast-rollback 2018-10-21 12:48:46 +09:00
Alex Miller e2fc1c9b95 Remove specifying non-root directory as a path to search for includes. 2018-10-19 18:56:45 -07:00
Clement Pang 3ceec01392 Address review comments. 2018-10-19 18:55:35 -07:00
Evan Tschannen 22b68d6cf3 fix: we need to get the result of the future before getting the error from the ErrorOr 2018-10-19 17:34:28 -07:00
Evan Tschannen 1ef29cbf0d more windows build fixes 2018-10-19 17:00:24 -07:00
Robert Escriva 268093a96d Adjust all includes to be relative to the root.
Remove the use of relative paths.  A header at foo/bar.h could be included by
files under foo/ with "bar.h", but would be included everywhere else as
"foo/bar.h".  Adjust so that every include references such a header with the
latter form.

Signed-off-by: Robert Escriva <rescriva@dropbox.com>
2018-10-19 17:35:33 +00:00