forked from github/orchestrator-agent
-
Notifications
You must be signed in to change notification settings - Fork 4
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
Orchestrator-agent. Redesign and support for new seed methods #1
Open
MaxFedotov
wants to merge
66
commits into
openark:master
Choose a base branch
from
MaxFedotov:orchestrator_agent_dev
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…e]*seed.SeedStageState
…edstage if it is already running
…ckage. Move post-seed-command to custom-commands section in config
…\md5 checksums for rpm
…t\stop\status commands. additonal logging
Hi, Thanks for your works ! I'm interested to test it, do you have any builds somewhere for both agent && orchestrator ? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi @shlomi-noach,
We spoke some time ago about adding support for different seed methods for orchestrator and orchestrator-agent, and here it is.
This PR adds following:
We define
seed
as an operation, which consists of a set of predefinedstages
, where 2 orchestrator agents participate - one agent is calledsource agent
(so it is on asource
side of seed), another -target agent
(so it is on atarget
side of seed), and the goal of seed is to transfer all data fromsource agent
totarget agent
and addtarget agent
as a slave tosource agent
.Seed
can be executed using differentseed methods
- special ways or programs used to transfer data fromsource agent
totarget agent
In order to simplify developing new
seed methods
for orchestrator-agent, each ofseed methods
should support following interface:By design, each
seed
operation consists of 5stages
, which are executed one after another byorchestrator
(and eachstage
is a function, whichseed method
should support and had a corresponding orchestrator-agent API method which is used by 'orchestrator' to start it) :Prepare
. On thisstage
different preparations for seed are done on both sides,target
andsource
. These preparations could be creating or cleanup of different directories, starting socat for data transferBackup
. On thisstage
backup is executed - transfer of data fromsource
totarget
. The side of the execution (target
orsource
) depends on the seed method (some of them, like mydumper\mysqldump\clone plugin, are executed ontarget
side, while xtrabackup\lvm are executed onsource
side). Each of the registeredseed methods
should provide information about theside
, on which backup process is executedRestore
. On thisstage
restore is executed. Thisstage
is always executed ontarget
side. Operations on this stage depend onseed method
- formysqldump
it's just uploading of .sql backup file to database, forxtrabackup
- it's more complex process of uncompressing\preparing data in backup.ConnectSlave
. Thisstage
will be executed completely byorchestrator
. During thisstage
target agent
is connected as a slave forsource agent
. But in order to implement this,orchestrator
should know position\gtids from backup. So it askstarget agent
to providebackup metadata
by callingGetMetadata
method.Cleanup
. Thisstage
is executed on both sides,target
andsource
. Different cleanup activities will be executed on this stage - cleaning backup directories, unmounting snapshotsOther functions in this Interface are helper methods:
isAvailable()
- is a function, which tests if seed method is available on a current host (for example, for xtrabackup it callsxtrabackup --version
command to check availability ofxtrabackup
binary)getSupportedEngines()
- returns an array of supported engines forseed method
. We need this because differentseed methods
supports different engines, and we can't, for example, usextrabackup
on MySQL 5.7 if there are tables withMyrocks
engine, as they are not supportedbackupToDatadir()
- is a helper function, which returns true in case of thisseed method
is capable of backing up data directly to mysql data directory (likextrabackup
`cloneplugin`, 'lvm' - the do not create intermediate backup files with data)Stages
are exposed throughorchestrator-agent
API andorchestrator
calls them in order.As each
stage
can take quite a big amount of time to execute, they are executed asynchronously in goroutines. In order to be able to track progress of eachstage
, 'seed method' sends to 'orchestrator-agent' information aboutseed stage
progress via channel and this information is also exposed through API, soorchestrator
can call this API to be able to trackstage
progress.That is the basic overview of the process from the
orchestrator-agent
side. All the philosophy is still the same as was - it's just exposes API calls to process seed and all logic is handled on theorchestrator
side.If you want to test it - there are integration tests available for all seed methods for different versions of mysql (5.7 and 8) and different binlog settings (gtid and positional). They are located in /tests/integration/ folders and in README.MD there is information about how to run them.
We started testing new agent and orchestrator functionality on our staging environments and I think we will find different issues related to this PR, so I think this functionality should be mostly classified as
beta
right now.But I will be very grateful for your feedback and comments :)
Thanks,
Max