-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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: more changes #6714
orc: more changes #6714
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
change from
:memory:
tofile::memory:?mode=memory&cache=shared
, because:memory:
will open a new snapshot of the database for any new sqlite connection. The only reason you didn't notice a problem is that theorchestrator
code forces a single connection in the pool; that's because I've ran into deadlocks in the past that I couldn't solve. Ideally these can be solved sometime in the future, but thenfile::memory:?mode=memory&cache=shared
must be used or ese everything breaks. -
Do you still need help with
CGO
and Docker? I can look into that.
Removed CLI mode from orchestrator main. Now, the only mode is http. So, that argument is now unnecessary.
(iterating inline comment) CLI is used in integration tests; a but like vitess' endtoend
tests run command line vtctl
. In that sense it's useful to keep. Unless you convert all integrated tests to run orchestrator-client
, which is some undertaking.
Disabled hostname resolutions: This was not working inside kubernetes. Again, the vitess topo provides authoritative info for hostnames alreay.
Is it possible, though, that when you SHOW PROCESSLIST
or SHOW SLAVE STATUS
on some user's MySQL server, the hostname from the master/replicas does not match the way Vitess thinks it should show? If that happens, then orchestrator
will not build the topology view correctly. I'm concerned that we are unable to verify that, because who knows what setups different users may have.
I'd suggest restoring hostname resolutions to be on the safe side.
@@ -61,7 +61,7 @@ endif | |||
install: build | |||
# binaries | |||
mkdir -p "$${PREFIX}/bin" | |||
cp "$${VTROOT}/bin/"{mysqlctld,vtctld,vtctlclient,vtgate,vttablet,vtworker,vtbackup} "$${PREFIX}/bin/" | |||
cp "$${VTROOT}/bin/"{mysqlctld,orchestrator,vtctld,vtctlclient,vtgate,vttablet,vtworker,vtbackup} "$${PREFIX}/bin/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -19,9 +19,6 @@ | |||
# Use a temporary layer for the build stage. | |||
FROM vitess/bootstrap:mariadb103 AS builder | |||
|
|||
# Allows some docker builds to disable CGO | |||
ARG CGO_ENABLED=0 | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@@ -48,6 +45,7 @@ ENV MYSQL_FLAVOR MariaDB103 | |||
|
|||
# Copy artifacts from builder layer. | |||
COPY --from=builder --chown=vitess:vitess /vt/install /vt | |||
COPY --from=builder --chown=vitess:vitess /vt/src/vitess.io/vitess/web/orchestrator /vt/web/orchestrator |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
examples/local/orc_test.sh
Outdated
@@ -0,0 +1,57 @@ | |||
#!/bin/bash | |||
|
|||
# Copyright 2019 The Vitess Authors. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
# Copyright 2019 The Vitess Authors. | |
# Copyright 2020 The Vitess Authors. |
if !inst.RegexpMatchPatterns(instance.MasterKey.StringCode(), config.Config.DiscoveryIgnoreMasterHostnameFilters) { | ||
discoveryQueue.Push(instance.MasterKey) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh wow 🤞 hope this works 😅
_, unlock, err := ts.LockShard(context.TODO(), tablet.Keyspace, tablet.Shard, "Orc Recovery") | ||
ctx, cancel := context.WithTimeout(context.TODO(), 1*time.Second) | ||
defer cancel() | ||
_, unlock, err := ts.LockShard(ctx, tablet.Keyspace, tablet.Shard, "Orc Recovery") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
} else { | ||
err = tmc.UndoDemoteMaster(context.TODO(), tablet) | ||
err = tmc.UndoDemoteMaster(ctx, tablet) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah, nice! I like the Undo!
@@ -1535,9 +1559,10 @@ func getCheckAndRecoverFunction(analysisCode inst.AnalysisCode, analyzedInstance | |||
return electNewMaster, true | |||
case inst.MasterHasMaster: | |||
return fixClusterAndMaster, true | |||
case inst.MasterIsReadOnly: | |||
case inst.MasterIsReadOnly, inst.MasterSemiSyncMustBeSet, inst.MasterSemiSyncMustNotBeSet: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll answer the main comments separately.
} | ||
|
||
switch { | ||
case helpTopic != "": | ||
app.HelpCommand(helpTopic) | ||
case len(flag.Args()) == 0 || flag.Arg(0) == "cli": | ||
app.CliWrapper(*command, *strict, *instance, *destination, *owner, *reason, *duration, *pattern, *clusterAlias, *pool, *hostnameFlag) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will have to convert. I'll explain in the main answer.
log.Fatale(err) | ||
} | ||
fmt.Println(instanceKey.DisplayString()) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were removed because they conflict with the new durability plugin. Even you set it here, the plugin will undo the change if it notices that the setting doesn't agree with its expectations.
si.MasterTermStartTime = newMasterTablet.MasterTermStartTime | ||
return nil | ||
}) | ||
// Don't proceed if shard record could not be updated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment applies to the error check and nil return. It says that we should not ignore this error. LMK if there is a better way to phrase it.
Done
CGO works now.
I had to remove the CLI because there was no easy way to change the operator framework to add
I wasn't too sure about this, which is why the core code is still there and we can resurrect it if we run into issues. But enabling hostname resolution doesn't work in kubernetes. Those pod names masquerading as hostnames was causing confusion. I'm hoping we won't have to do this because Vitess has some cloud-friendly way of resolving hostnames. So, blindly trusting the ones provided by vitess should just work. 🤞 |
The issue is not that; I'm happy to trust the name resolving provided by vitess, that's fine. But, do we absolutely know for sure that if I |
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
Signed-off-by: Sugu Sougoumarane <ssougou@gmail.com>
752a5de
to
93d7efe
Compare
This seems to work fine. I just brought up a cluster and looked at the replica info. They show up as IP in the UI also. I think it woks fine because we also use the same IP while wiring up the replicas using |
Since we're moving iteratively, the individual commits are not necessarily holistic. So, I'm combining everything done so far into one PR:
vitess/lite
container.