-
Notifications
You must be signed in to change notification settings - Fork 938
actualize Vagrant and fix problems on orchestrator-agent api with sqlite backend #445
Conversation
…api with sqlite backend Signed-off-by: Slach <bloodjazman@gmail.com>
@@ -547,8 +547,8 @@ func AbortSeed(seedId int64) error { | |||
} | |||
|
|||
// PostCopy will request an agent to invoke post-copy commands | |||
func PostCopy(hostname string) (Agent, error) { | |||
return executeAgentCommand(hostname, "post-copy", nil) | |||
func PostCopy(hostname, sourceHostname string) (Agent, error) { |
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.
Is this change going to break behavior for existing users?
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.
could you help me figure out howto add optional parameter to martini routes?
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.
@shlomi-noach ok.
i add backwards compatibility on orchestrator-agent here
https://github.com/github/orchestrator-agent/pull/20/files#diff-fbdc8cde28a71961e53c2e83e2483c9aL619
and add some other improvments and tested it with percona-xtrabackup
currenly in my setup i have successfull data seed between nodes over netcat + xtrabackup + xbstream
# scripts, such as exporting variables or whatever. It's yours! | ||
[ -f /etc/default/orchestrator ] && . /etc/default/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.
Please explain why /etc/default/orchestrator
? IF anything, I'd add /etc/profile.d/orchestrator
which is what I should have done in the first place.
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.
/etc/default it's a default behavion on debian based distributives
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.
ok, i add usage /etc/profile.d/orchestrator
and /etc/default/orchestrator
/etc/profile.d/orchestrator
will have major priority
Thank you! This PR is growing bigger and deals with different problems, so it's becoming difficult for me to review it as a whole. Can you please elaborate on "i add backwards compatibility on orchestrator-agent here" ? Where is the backwards compatibility found? |
@@ -164,7 +164,7 @@ func ReadOutdatedAgentsHosts() ([]string, error) { | |||
from | |||
host_agent | |||
where | |||
IFNULL(last_checked < now() - interval ? minute, true) | |||
IFNULL(last_checked < now() - interval ? minute, 1) |
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.
this change need for SQLlite compatibility cause SQLite desn't have BOOLEAN literal
func PostCopy(hostname string) (Agent, error) { | ||
return executeAgentCommand(hostname, "post-copy", nil) | ||
func PostCopy(hostname, sourceHostname string) (Agent, error) { | ||
return executeAgentCommand(hostname, fmt.Sprintf("post-copy/?sourceHost=%s", sourceHostname), nil) |
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 is backwards compatibility
https://github.com/github/orchestrator-agent/pull/20/files#diff-fbdc8cde28a71961e53c2e83e2483c9aL619 |
I will get back on this early next week. |
ok. i hope my PR will be merged ;) |
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.
Thank you for the PR! and I'm sorry for the slow response; I have had some busy days and will have yet more busy days ahead of me.
One critical change, and some questions.
.idea/ | ||
*.deb | ||
*.pcap | ||
*.log |
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.
👍
Vagrantfile
Outdated
config.vm.synced_folder '.', '/orchestrator', type: 'rsync', | ||
rsync__auto: true | ||
config.vm.synced_folder '.', '/orchestrator' | ||
#, type: 'rsync', rsync__auto: true |
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.
Can you please explain this change?
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.
rsync__auto want work on my Vagrant environment ;(
when i change some sources on host OS, it's not rsynced into guest maching
ok. i rollback this change
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.
Sorry, please elaborate. Did you introduce rsync__auto
in the first place?
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 try use following variants
1)
config.vm.synced_folder '.', '/orchestrator', type: 'rsync'
it's require run vagrant reload
when i change any file on my host machine
2)
config.vm.synced_folder '.', '/orchestrator', type: 'rsync', rsync__auto: true
it not worked, and i don't investigate why
then i just commented this options and default sharing mode over vboxfs works as i expected
@@ -87,7 +87,7 @@ function oinstall() { | |||
cd $mydir | |||
gofmt -s -w go/ | |||
rsync -qa ./resources $builddir/orchestrator${prefix}/orchestrator/ | |||
rsync -qa ./conf/orchestrator-sample.* $builddir/orchestrator${prefix}/orchestrator/ | |||
rsync -qa ./conf/orchestrator-sample*.conf.json $builddir/orchestrator${prefix}/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.
👍
build.sh
Outdated
# n CentOD 6 box: we only want the rpms for CentOS6 | ||
# Add "-centos6" to the file name. | ||
ls ${TOPDIR:-?}/*.rpm | while read f; do centos_file=$(echo $f | sed -r -e "s/^(.*)-${RELEASE_VERSION}(.*)/\1-centos6-${RELEASE_VERSION}\2/g") ; mv $f $centos_file ; done | ||
if [[ -e /etc/centos-release ]]; then |
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.
better: -f
"GraphiteAddr": "", | ||
"GraphitePath": "", | ||
"GraphiteConvertHostnameDotsToUnderscores": true | ||
} |
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.
👍
@@ -693,7 +693,7 @@ func executeSeed(seedId int64, targetHostname string, sourceHostname string) err | |||
} | |||
|
|||
seedFromLogicalVolume := sourceAgent.LogicalVolumes[0] | |||
seedStateId, _ = submitSeedStateEntry(seedId, fmt.Sprintf("Mounting logical volume: %s", seedFromLogicalVolume.Path), "") | |||
seedStateId, _ = submitSeedStateEntry(seedId, fmt.Sprintf("%s Mounting logical volume: %s", sourceHostname, seedFromLogicalVolume.Path), "") |
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.
👍
seedStateId, _ = submitSeedStateEntry(seedId, fmt.Sprintf("Waiting some time for %s to start listening for incoming data", targetHostname), "") | ||
time.Sleep(2 * time.Second) | ||
seedStateId, _ = submitSeedStateEntry(seedId, fmt.Sprintf("Waiting %d seconds for %s to start listening for incoming data", config.Config.SeedWaitSecondsBeforeSend, targetHostname), "") | ||
time.Sleep(time.Duration(config.Config.SeedWaitSecondsBeforeSend) * time.Second) |
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.
👍
go/db/generate_base.go
Outdated
@@ -138,7 +138,7 @@ var generateSQLBase = []string{ | |||
last_checked timestamp NULL DEFAULT NULL, | |||
last_seen timestamp NULL DEFAULT NULL, | |||
mysql_port smallint(5) unsigned DEFAULT NULL, | |||
count_mysql_snapshots smallint(5) unsigned NOT NULL, | |||
count_mysql_snapshots smallint(5) unsigned NOT NULL DEFAULT 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.
🚫 Must change: existing SQL must never ever change. The most we can do is add a modification in generate_patches.go
. However, modifying a column is not supported by sqlite
so this change must unfortunately go away.
The value is implicitly 0
anyway, what is the concern?
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. ok. sorry i will rollback this change
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.
yes concern is
count_mysql_snapshots not used when try insert into host_agent
table
and sql query is failed when agent submitting
rollback generate_base.go after openark#445 (comment)
# n CentOD 6 box: we only want the rpms for CentOS6 | ||
# Add "-centos6" to the file name. | ||
ls ${TOPDIR:-?}/*.rpm | while read f; do centos_file=$(echo $f | sed -r -e "s/^(.*)-${RELEASE_VERSION}(.*)/\1-centos6-${RELEASE_VERSION}\2/g") ; mv $f $centos_file ; done | ||
fi |
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.
👍
vagrant/admin-build.sh
Outdated
/usr/sbin/service orchestrator start | ||
|
||
fi | ||
|
||
echo '* * * * * root /usr/bin/orchestrator -c discover -i db1' > /etc/cron.d/orchestrator-discovery | ||
|
||
# Discover instances | ||
/usr/bin/orchestrator -c discover -i localhost | ||
/usr/bin/orchestrator --verbose --debug --stack -c redeploy-internal-db |
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.
What happened that the above became necessary? Current logic should make it safe to run orchestrator
without specifying redeploy-internal-db
.
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.
ohh, sorry, i multiple run vagrant up
and add redeploy-internal-db to try fix errors when using sqlite backend
i revert this changes right now
@shlomi-noach would this PR ready for merge? i think i resolve any recomendation |
thanks! |
Thank you! |
Related issue: #438
Description
This PR actualize Vagrant and fix problems on orchestrator-agent api with sqlite backend
i hope this help use innodbbackupex for data seeding between two mysql nodes
gofmt
(please avoidgoimports
)./build.sh
go test ./go/...