-
Notifications
You must be signed in to change notification settings - Fork 2.3k
orc: vitess mode #6613
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
orc: vitess mode #6613
Changes from all commits
a56d7b4
2f70bae
b39bf89
9b75b74
06cce27
23d9929
7a98cfa
acebb77
2dcde5c
0a7d83a
88a8549
5d699e5
9c3e067
5821782
e2ccf88
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| { | ||
| "Debug": true, | ||
| "MySQLTopologyUser": "orc_client_user", | ||
| "MySQLTopologyPassword": "orc_client_user_password", | ||
| "MySQLReplicaUser": "vt_repl", | ||
| "MySQLReplicaPassword": "", | ||
| "BackendDB": "sqlite", | ||
| "SQLite3DataFile": "/home/sougou/dev/src/vitess.io/vitess/vtdataroot/orchestrator.sqlite3", | ||
| "RecoverMasterClusterFilters": ["*"], | ||
| "RecoveryPeriodBlockSeconds": 1, | ||
| "DelayMasterPromotionIfSQLThreadNotUpToDate": true | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| Copyright 2019 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreedto in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package main | ||
|
|
||
| // This plugin imports consultopo to register the consul implementation of TopoServer. | ||
|
|
||
| import ( | ||
| _ "vitess.io/vitess/go/vt/topo/consultopo" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| Copyright 2019 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package main | ||
|
|
||
| // This plugin imports etcd2topo to register the etcd2 implementation of TopoServer. | ||
|
|
||
| import ( | ||
| _ "vitess.io/vitess/go/vt/topo/etcd2topo" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| Copyright 2019 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package main | ||
|
|
||
| // Imports and register the gRPC tabletmanager client | ||
|
|
||
| import ( | ||
| _ "vitess.io/vitess/go/vt/vttablet/grpctmclient" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| Copyright 2020 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package main | ||
|
|
||
| // This plugin imports k8stopo to register the kubernetes implementation of TopoServer. | ||
|
|
||
| import ( | ||
| _ "vitess.io/vitess/go/vt/topo/k8stopo" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| Copyright 2019 The Vitess Authors. | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); | ||
| you may not use this file except in compliance with the License. | ||
| You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreedto in writing, software | ||
| distributed under the License is distributed on an "AS IS" BASIS, | ||
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
| See the License for the specific language governing permissions and | ||
| limitations under the License. | ||
| */ | ||
|
|
||
| package main | ||
|
|
||
| // Imports and register the zk2 TopologyServer | ||
|
|
||
| import ( | ||
| _ "vitess.io/vitess/go/vt/topo/zk2topo" | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,19 +20,28 @@ import ( | |
| "encoding/json" | ||
| "fmt" | ||
| "strings" | ||
| "time" | ||
|
|
||
| "vitess.io/vitess/go/vt/orchestrator/config" | ||
| topodatapb "vitess.io/vitess/go/vt/proto/topodata" | ||
| ) | ||
|
|
||
| type AnalysisCode string | ||
| type StructureAnalysisCode string | ||
|
|
||
| const ( | ||
| NoProblem AnalysisCode = "NoProblem" | ||
| ClusterHasNoMaster AnalysisCode = "ClusterHasNoMaster" | ||
| DeadMasterWithoutReplicas AnalysisCode = "DeadMasterWithoutReplicas" | ||
| DeadMaster AnalysisCode = "DeadMaster" | ||
| DeadMasterAndReplicas AnalysisCode = "DeadMasterAndReplicas" | ||
| DeadMasterAndSomeReplicas AnalysisCode = "DeadMasterAndSomeReplicas" | ||
| MasterHasMaster AnalysisCode = "MasterHasMaster" | ||
| MasterIsReadOnly AnalysisCode = "MasterIsReadOnly" | ||
| ReplicaIsWritable AnalysisCode = "ReplicaIsWritable" | ||
| NotConnectedToMaster AnalysisCode = "NotConnectedToMaster" | ||
| ConnectedToWrongMaster AnalysisCode = "ConnectedToWrongMaster" | ||
| ReplicationStopped AnalysisCode = "ReplicationStopped" | ||
| UnreachableMasterWithLaggingReplicas AnalysisCode = "UnreachableMasterWithLaggingReplicas" | ||
| UnreachableMaster AnalysisCode = "UnreachableMaster" | ||
| MasterSingleReplicaNotReplicating AnalysisCode = "MasterSingleReplicaNotReplicating" | ||
|
|
@@ -116,12 +125,16 @@ const ( | |
| type ReplicationAnalysis struct { | ||
| AnalyzedInstanceKey InstanceKey | ||
| AnalyzedInstanceMasterKey InstanceKey | ||
| TabletType topodatapb.TabletType | ||
| MasterTimeStamp time.Time | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this timestamp stand for?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This was our first step towards a consensus protocol. Every newly elected master saves its timestamp. If the previous master did not get properly demoted (maybe it wasn't reachable), then we use the timestamp to resolve who the real master is. I'm not happy that we currently rely on a timestamp because rogue clocks can mess things up. We should eventually move towards a system that doesn't depend on the clock. |
||
| SuggestedClusterAlias string | ||
| ClusterDetails ClusterInfo | ||
| AnalyzedInstanceDataCenter string | ||
| AnalyzedInstanceRegion string | ||
| AnalyzedInstancePhysicalEnvironment string | ||
| AnalyzedInstanceBinlogCoordinates BinlogCoordinates | ||
| IsMaster bool | ||
| IsClusterMaster bool | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In this new world, |
||
| IsCoMaster bool | ||
| LastCheckValid bool | ||
| LastCheckPartialSuccess bool | ||
|
|
@@ -134,6 +147,7 @@ type ReplicationAnalysis struct { | |
| Replicas InstanceKeyMap | ||
| SlaveHosts InstanceKeyMap // for backwards compatibility. Equals `Replicas` | ||
| IsFailingToConnectToMaster bool | ||
| ReplicationStopped bool | ||
| Analysis AnalysisCode | ||
| Description string | ||
| StructureAnalysis []StructureAnalysisCode | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.