actualize Vagrant and fix problems on orchestrator-agent api with sqlite backend#445
actualize Vagrant and fix problems on orchestrator-agent api with sqlite backend#445shlomi-noach merged 18 commits intoopenark:masterfrom
Conversation
…api with sqlite backend Signed-off-by: Slach <bloodjazman@gmail.com>
| // 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.
Is this change going to break behavior for existing users?
There was a problem hiding this comment.
could you help me figure out howto add optional parameter to martini routes?
There was a problem hiding this comment.
There was a problem hiding this comment.
@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
| # The file /etc/orchestrator_profile can be used to inject pre-service execution | ||
| # This files can be used to inject pre-service execution | ||
| # scripts, such as exporting variables or whatever. It's yours! | ||
| [ -f /etc/default/orchestrator ] && . /etc/default/orchestrator |
There was a problem hiding this comment.
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.
/etc/default it's a default behavion on debian based distributives
There was a problem hiding this comment.
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? |
| host_agent | ||
| where | ||
| IFNULL(last_checked < now() - interval ? minute, true) | ||
| IFNULL(last_checked < now() - interval ? minute, 1) |
There was a problem hiding this comment.
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.
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 ;) |
shlomi-noach
left a comment
There was a problem hiding this comment.
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 |
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.
Can you please explain this change?
There was a problem hiding this comment.
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.
Sorry, please elaborate. Did you introduce rsync__auto in the first place?
There was a problem hiding this comment.
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
| 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/ |
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 |
| "GraphiteAddr": "", | ||
| "GraphitePath": "", | ||
| "GraphiteConvertHostnameDotsToUnderscores": true | ||
| } |
|
|
||
| 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), "") |
| 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) |
go/db/generate_base.go
Outdated
| 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.
🚫 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.
oh. ok. sorry i will rollback this change
There was a problem hiding this comment.
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 |
vagrant/admin-build.sh
Outdated
|
|
||
| # 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.
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.
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.shgo test ./go/...