Commit Graph

498 Commits

Author SHA1 Message Date
tclinken 1d6ac716a1 Merge remote-tracking branch 'origin' into add-data-distribution-metrics 2020-01-15 13:20:04 -08:00
Evan Tschannen 9b80498180 Added a trace event to warn if a shard is merged before enough time has elapses from becoming low bandwidth 2020-01-10 14:58:38 -08:00
Evan Tschannen c2608f0af9 fix: completeSources could be larger than the teamSize, so we need to check all completeSources
we do not need to track bestSize, since all teams in the list will be the same size
2020-01-10 14:46:40 -08:00
Evan Tschannen ab7071932f Data distribution no longer attempts to pick teams which share members of the source unless the team matches exactly 2020-01-09 16:59:37 -08:00
Evan Tschannen 83ad9caf54 implemented a load balancing algorithm which evens out the number of requests processes by each proxy 2020-01-08 01:59:01 -08:00
Evan Tschannen 59738e8ef1 fixed compiler error 2019-11-22 16:19:34 -08:00
Evan Tschannen 3c769fcf60 Merge branch 'release-6.2'
# Conflicts:
#	CMakeLists.txt
#	documentation/sphinx/source/release-notes.rst
#	fdbserver/ClusterController.actor.cpp
#	fdbserver/MasterProxyServer.actor.cpp
#	versions.target
2019-11-22 15:39:19 -08:00
Evan Tschannen 3a3ab5664b fix: team trackers for bad teams that contain a removed servers must be cancelled or the cluster will falsely report those teams as failed 2019-11-22 10:20:13 -08:00
Andrew Noyes d4de608bb6 Fix OPEN_FOR_IDE build 2019-10-25 10:42:22 -07:00
Evan Tschannen f8e44d2f71 fix: If a storage server was offline, it would not be checked for being in an undesired dc 2019-10-23 23:04:39 -07:00
Jon Fu d2b6626d5c Merge branch 'master' of https://github.com/apple/foundationdb into mark-ss-failed 2019-10-21 13:47:06 -07:00
Evan Tschannen 688940b685 merge 6.2 into master 2019-10-21 11:43:46 -07:00
Jon Fu b1fd6b4443 addressed review comments 2019-10-18 09:43:25 -07:00
Jon Fu 896701006f addressed code review changes 2019-10-16 11:30:20 -07:00
Evan Tschannen 86bcb84b45 Raised the data distribution priority of splitting shards above restoring fault tolerance to avoid hot write shards 2019-10-11 17:50:43 -07:00
Jon Fu 34baa37e60 Merge branch 'master' of https://github.com/apple/foundationdb into mark-ss-failed 2019-10-10 10:14:58 -07:00
Meng Xu 1bd6151f54
Update fdbserver/DataDistribution.actor.cpp
Co-Authored-By: Jingyu Zhou <jingyuzhou@gmail.com>
2019-10-09 21:17:03 -07:00
Meng Xu 26e1d565f6 StorageServerTracker:Fix OOM bug caused by server healthyness toggles infinitely
When there is only one healthy team, the bug will set a server's status as unhealthy;
which causes the healthyTeam to 0, triggering StorageServerTracker to loop back;
which resets the server's status to healthy, and thus the healthyTeam to non-zero.

This pattern will cause infinite loop.

Infinite loop will prevent TraceEvent from flushing, which causes
TraceEvent to use most of memory and out-of-memory.

Kudos to JingYu Zhou (jingyu_zhou@apple.com) who is the main contributor who found the bug!
2019-10-09 17:45:09 -07:00
Jon Fu eb41e32876 add extra dd safety check to deny exclude if only 1 team exists 2019-10-08 16:10:09 -07:00
Jon Fu ff563c1672 fixed trace line description 2019-10-07 12:45:27 -07:00
Jon Fu d146f1d636 Merge branch 'master' of https://github.com/apple/foundationdb into mark-ss-failed 2019-10-07 11:27:15 -07:00
A.J. Beamon 22c3fa867c
Merge pull request #2074 from xumengpanda/mengxu/fix-correctness-bug
DD:fix:getTeam may fail to get a team when it can
2019-10-07 09:33:57 -07:00
Jon Fu cc41cd610d force recheck in tracker if team contains failed server 2019-10-04 14:02:12 -07:00
Meng Xu 6dae95a4ca
Update fdbserver/DataDistribution.actor.cpp
Co-Authored-By: A.J. Beamon <ajbeamon@users.noreply.github.com>
2019-10-04 10:02:11 -07:00
Jon Fu 31332da57d move option setting inside retry loop 2019-10-03 13:24:28 -07:00
Jon Fu abb46d527b fixed implementation of watches in TrackExcludedServers 2019-10-03 13:18:05 -07:00
Jon Fu d96a7b2c69 Merge branch 'master' of https://github.com/apple/foundationdb into mark-ss-failed 2019-10-03 09:47:45 -07:00
Meng Xu 5286523a43 StorageServerTracker:Distinguish wrongDC from invalidLocality 2019-10-02 14:50:53 -07:00
Meng Xu 9e7dfa358c Replace isCorrectDC with isCorrectLocality
This incorporates the change for defending DD from misconfigured
locality entries.

The check for misconfigured locality was in keyValueStoreTypeTracker,
but the storage engine switch PR moves the isCorrectDC checking out of
the tracker and move it into storageServerTracker
2019-10-02 14:05:43 -07:00
Meng Xu d0147e5e5d Merge branch 'release-6.2' into mengxu/merge-release620-to-master-v3
Resolved Conflicts:
	documentation/sphinx/source/release-notes.rst
	fdbserver/DataDistribution.actor.cpp
	versions.target
2019-10-02 13:22:56 -07:00
Evan Tschannen 4b5080fbea added a few more missing data distribution priorities 2019-09-27 19:39:53 -07:00
Evan Tschannen 324d0bd3b0 Merge branch 'release-6.2' of github.com:apple/foundationdb into feature-cleanup-mutations 2019-09-27 19:15:14 -07:00
Evan Tschannen 3bb62e008c lowered the priority of some delays in data distribution so that the process will prefer other work 2019-09-27 18:33:13 -07:00
Jon Fu efa2f5df6b avoid double overwrite on failed servers and reordered removal of keys 2019-09-26 13:52:53 -07:00
Jon Fu 450a09e117 Code Review Changes 2019-09-24 15:48:50 -07:00
Meng Xu 32ebd08f9f DD:Trigger storage recruitment when an invalid address locality is corrected 2019-09-24 13:35:38 -07:00
Meng Xu 515689d07b
Update fdbserver/DataDistribution.actor.cpp
Co-Authored-By: A.J. Beamon <ajbeamon@users.noreply.github.com>
2019-09-18 14:45:18 -07:00
Meng Xu d175b61a62 DD:Trace when invalid locality is corrected
Change getWorkers param from txn handler to db
2019-09-18 13:52:54 -07:00
Jon Fu 40ad6f0931 created new reply types to work with flatbuffer serialization requirements 2019-09-18 13:40:18 -07:00
Jon Fu 471e283128 Merge branch 'master' of https://github.com/apple/foundationdb into mark-ss-failed 2019-09-18 11:49:07 -07:00
Meng Xu 93bbc26a35 set:erase:Use return value of erase iterator as next iterator 2019-09-17 15:28:30 -07:00
Meng Xu d2fd1f4931 DD:MisconfiguredLocality:Fix review comments 2019-09-17 13:04:21 -07:00
Meng Xu 37d2318eed DD:Handle worker with incorrect locality
When a worker has incorrect locality, the worker will be excluded from
storage recruitment.
When the worker has its locality corrected by system operators,
the worker will be reincluded for storage recruitment.
2019-09-14 12:12:56 -07:00
Meng Xu c3960aba17 DD:initializeStorage:Exclude worker with invalid locality 2019-09-13 22:05:41 -07:00
Meng Xu 75460089e1 DD_VALIDATE_LOCALITY:Add comment for our future selves
When we add simulation test that misconfigure a cluster by not setting some
locality entries, we should set DD_VALIDATE_LOCALITY always true.
Otherwise, simulation tests may fail.
2019-09-13 16:26:54 -07:00
Meng Xu 78b8e48cef DD:ValidLocality:Resolve review comment 2019-09-13 15:35:16 -07:00
Meng Xu e1dcdbf3d2 LocalityData:Remove verbose check for valid locality 2019-09-13 15:11:13 -07:00
Meng Xu 8970d9858b DD:isValidLocality:A generic way to check any replicationPolicy 2019-09-13 14:55:51 -07:00
Meng Xu 1196841b3d DD:IsValidLocality:Clang format 2019-09-13 13:56:43 -07:00
Meng Xu e8878b16d4 DD:Valid locality includes an empty but set locality entry 2019-09-13 13:55:46 -07:00
Meng Xu 1596e2e4a5 DD:TCMachine:Use processID as machineID if zoneID is unset 2019-09-13 13:43:41 -07:00
Meng Xu 3ad7e3adb3 DD:DD_VALIDATE_LOCALITY:Guard the checking of locality validity 2019-09-13 13:19:35 -07:00
Meng Xu 90d6a27a0d DD:IsValidLocality:Consider configured replica policy 2019-09-13 12:04:49 -07:00
Meng Xu 52f6297b52 DD:Introduce isValidLocality
A server or machine has a valid locality only if it sets correct
locality entries.

Build teams should only use the valid locality servers or machines
2019-09-13 11:30:26 -07:00
Evan Tschannen b495cc697b Merge branch 'release-6.2'
# Conflicts:
#	CMakeLists.txt
#	documentation/sphinx/source/release-notes.rst
#	versions.target
2019-09-13 09:25:08 -07:00
Evan Tschannen cc41f3e2fc fix: an unhealthy server with a low number of teams could cause data distribution to build every possible teams 2019-09-12 14:18:10 -07:00
Meng Xu 2081302a89 DD:GetTeam:Add trace event GetTeamReturnEmpty
Log BestTeamStuck reason when we have healthy teams
but they do not have healthy free space
2019-09-11 14:48:39 -07:00
Meng Xu 3c4dc1003d DD:clang-format the PR 2019-09-11 11:16:29 -07:00
Meng Xu a83afa5f64 DD:BgDDValleyFiller:Do not move shard to a team with no healthy space 2019-09-11 11:15:00 -07:00
Meng Xu 8e47a05326 DD:TeamInfo:Add HasHealthyFreeSpace field 2019-09-09 18:42:18 -07:00
Meng Xu 259ca36aa2 DD:Random pick from valid teams 2019-09-09 18:28:39 -07:00
Meng Xu 0b785e5c1c DD:getTeam may fail to get a team when it can
Due to randomness, when unhealthy teams are majority while there still
exists healthy teams, getTeam function may be unlucky to find
any feasible (ok) team, which leads to BestTeamStuck situation.

This commit increases the tries from 10 to 20.

A long-term solution may first find all feasible teams and choose a random
one from them. Since This can affect the statistics of which team is picked.
So it is not included in this commit.

Non-functional change: This commit removes unneeded printf introduced by
fast restore PR 1404.
2019-09-07 20:08:58 -07:00
Jon Fu def1294aab moved wait statement to avoid context switch between check and execution 2019-09-04 12:42:27 -07:00
Meng Xu 8f9ba3bc09 StorageEngineSwitch:Remove unused code 2019-09-03 17:18:56 -07:00
Jon Fu dbc993a138 change use of reference to raw ptr to avoid unwanted delay of destructors 2019-09-03 16:27:14 -07:00
Meng Xu bd80a67d46 Merge branch 'master' into mengxu/storage-engine-switch-PR-v2 2019-09-03 14:11:33 -07:00
sramamoorthy 5d87443323 improved error msgs for snapshot cmd 2019-08-27 16:43:52 -07:00
Jon Fu 202900bd79 adjusted priority of relocateShard requests if team contains failed server 2019-08-27 14:39:44 -07:00
Jon Fu 93079c6657 always attempt to send RelocateShard requests if team has a failed server 2019-08-27 14:39:44 -07:00
Jon Fu 3666c0c776 added more trace lines and added timeout to safety check in test workload 2019-08-27 14:39:44 -07:00
Jon Fu a757e66327 Revert "restart team builder when storage server fails"
This reverts commit d661efacc215c4db7c7c338e16591463267e80d7.
2019-08-27 14:39:44 -07:00
Jon Fu d61bfe3e96 restart team builder when storage server fails 2019-08-27 14:39:44 -07:00
Jon Fu 04d514c483 added a wait to check for master proxies changed and put in a few more trace events 2019-08-27 14:39:44 -07:00
Jon Fu 00c2025d4b fixed removeKeys impl, adjusted test workload, and introduced extra safety checks to NativeAPI and proxy 2019-08-27 14:39:44 -07:00
Jon Fu a07cf5d038 addressed code review comments 2019-08-27 14:39:44 -07:00
Jon Fu 080fbc63dc updated keyServers removal to be multi-transactional in order to avoid hitting transaction timeout 2019-08-27 14:39:43 -07:00
Jon Fu ddfcbae929 added exclusion logic to account for entire machines when no port is specified 2019-08-27 14:39:43 -07:00
Jon Fu 5a877d6b14 added safety check on client to prevent removing all servers from a team 2019-08-27 14:39:43 -07:00
Jon Fu 66bba51988 Implemented direct removal of failed storage server from system keyspace 2019-08-27 14:39:43 -07:00
Jon Fu c908c6c1db added command to fdbcli and changes to SystemData and ManagementAPI 2019-08-27 14:39:43 -07:00
Meng Xu cc6dccf6a4 StorageEngineSwitch:Remove existOtherHealthyTeams actor
We no longer needs this actor because the removeWrongStoreType actor
will remove a storage server only when the DD is healthy.
2019-08-22 13:21:03 -07:00
Meng Xu a377261740 StorageEngineSwitch:Remove questions in comments 2019-08-22 11:49:39 -07:00
Meng Xu 5ddf2b16be StorageEngineSwitch:Wait until DD is healthy before remove a wrong storeType server 2019-08-22 11:47:12 -07:00
Meng Xu 9bb646db30 StorageEngineSwitch:Resolve review comments
1) Rely on the fact that the wrong storeType server will signal removeWrongStoreType
back to re-check the next server with wrong storeType.

Do not rely on timeout as a safeguard to trigger removeWrongStoreType actor.

Note:
removeWrongStoreType actor will not check if there is a storage server with wrong
store type, unless the DD is healthy.
Removing a storage server while DD is not healthy may trigger weird failure cases and
also cause negative impact on cluster performance.

2) Remove try catch in KeyValueStoreTypeTracker
Let the caller handle exceptions, e.g., actor cancelling exception

3) Cleanup debug message and clang-format code
2019-08-22 09:59:47 -07:00
Meng Xu 39680fa515 StorageEngineSwitch:Clean up unnecessary trace
And do not trigger storage recruitment unnecessarily.
2019-08-19 14:11:57 -07:00
Meng Xu b448f92d61 StorageEngineSwitch:Remove unnecessary code and format code
Uncessary code include debug code and the unnecessary calling of
the removeWrongStoreType actor;

Format the changes with clang-format as well.
2019-08-16 16:53:38 -07:00
Meng Xu 0648388b25 StorageEngineSwitch:Prefer remove SS without causing zero healthy teams 2019-08-16 16:34:23 -07:00
Meng Xu 85ba904e2c StorageEngineSwitch:Stop removeWrongStoreType actor if no SS has wrong storeType 2019-08-16 16:11:28 -07:00
Meng Xu 2859dc57a8 StorageEngineSwitch:Only allow one pending recruitment on a worker 2019-08-16 15:04:11 -07:00
Evan Tschannen 297b65236f added additional trace events to warn when different parts of shard relocations take more than 10 minutes 2019-08-16 14:56:58 -07:00
Meng Xu 2a7b208df2 StorageEngineSwitch:Call removeWrongStoreType only when necessary
If a cluster does not change its storeType for a while, we do not need to
call removeWrongStoreType actor periodically.

This solution is the same as how badTeamRemover actor is handled.
2019-08-16 10:48:53 -07:00
Meng Xu 86b51624a4 StorageEngineSwitch:Check next SS to remove once old one is removed 2019-08-16 10:43:20 -07:00
Meng Xu 0ad68fb89f StorageEngineSwitch:Timeout if to-be-removed SS fails
In case the wrong storeType SS picked to be removed fails before
it triggers the next round of checking if a SS has wrong store type,
we should time out and invoke the checking.

Otherwise, the removeWrongStoreType actor will never be running again.
2019-08-15 17:03:53 -07:00
Meng Xu 980fa39c23 StorageEngineSwitch:Speed up removing wrong storeType server in simulation 2019-08-15 15:55:11 -07:00
Meng Xu 794009b242 StorageEngineSwitch:Limit SS num per proc
Multiple storage server recruitment requests may be buffered in
cluster controller, hoping that in the near future cluster controller
will find an available worker for the request.

It is possible that many outstanding storage recruitment requests are
fullfilled by the cluster controller in a very short time interval.

When DD recruit those requests, it blindly initiaze a storage server
on the recruited worker and let the storage server tracker remove
storage servers on the same process (ip, port).

This is problematic because multiple SS on the same process can push
the process OOM. Even in simulation, initializing too many SS causes
simulator OOM.

This commit limits the max number of SS on a process to be 2.

We cannot enforce the number of SS on a process to be 1 right now,
because current simulation tests may change configuration in a situation that
without allowing more than 1 SS on a process will fail the tests.
2019-08-15 14:08:43 -07:00
Meng Xu 4a321f983a StorageEngineSwitch:Periodic check if a server has wrong storeType
If DD checks storage server's storeType before some storage servers are
fully available, DD may miss those storage servers to remove.

To ensure no storage servers with wrong storeType is missed, SS marks the
doRemoveWrongStoreType to be true.

To avoid removing multiple servers at the same time, the actor waits for a
configurable delay before checking and removing a storage server.
2019-08-13 17:35:18 -07:00
Meng Xu 3bc1f38b43 StorageServerTracker:Do not recruit until a SS is shutdown
When a storage server is detected by the storageServerFailureTracker as failed,
we should not immediately restart recruiting new storage server on the same address,
which will cause OOM error on the address.

The existing logic removeServer() function will remove the failed server from
server_info and trigger recruiting new storage servers.
2019-08-13 16:10:20 -07:00
Meng Xu 24047defff StorageEngineSwitch:Remove and rename server variables
Remove unused toRemove variable from server_info,
Rename wrongStoreTypeRemoved to wrongStoreTypeToRemove.
2019-08-13 15:44:48 -07:00
Meng Xu e6284684f0 StorageEngineSwitch:Always remove wrong storeType SS
In the old logic of switching storage engines, it marks a storage server
with wrong store type as undesired even though this can lead to no healthy team.

In the first version of the new storage engine switch, we mimic the same logic
of the old version.
2019-08-13 14:59:46 -07:00
Meng Xu b216cd2516 StorageEngineSwitch:Use AsyncVar to signal server to remove
Trigger does not have an effect if the receiver is not waiting on the trigger.
To ensure the wrong store type server that is selected to be removed is removed,
we should use an AysncVar<bool> to trigger the storage tracker.
2019-08-12 18:14:05 -07:00