forked from github/orchestrator-agent
-
Notifications
You must be signed in to change notification settings - Fork 4
Orchestrator-agent. Redesign and support for new seed methods #1
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
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 hidden or 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
seedas an operation, which consists of a set of predefinedstages, where 2 orchestrator agents participate - one agent is calledsource agent(so it is on asourceside of seed), another -target agent(so it is on atargetside of seed), and the goal of seed is to transfer all data fromsource agenttotarget agentand addtarget agentas a slave tosource agent.Seedcan be executed using differentseed methods- special ways or programs used to transfer data fromsource agenttotarget agentIn order to simplify developing new
seed methodsfor orchestrator-agent, each ofseed methodsshould support following interface:By design, each
seedoperation consists of 5stages, which are executed one after another byorchestrator(and eachstageis a function, whichseed methodshould support and had a corresponding orchestrator-agent API method which is used by 'orchestrator' to start it) :Prepare. On thisstagedifferent preparations for seed are done on both sides,targetandsource. These preparations could be creating or cleanup of different directories, starting socat for data transferBackup. On thisstagebackup is executed - transfer of data fromsourcetotarget. The side of the execution (targetorsource) depends on the seed method (some of them, like mydumper\mysqldump\clone plugin, are executed ontargetside, while xtrabackup\lvm are executed onsourceside). Each of the registeredseed methodsshould provide information about theside, on which backup process is executedRestore. On thisstagerestore is executed. Thisstageis always executed ontargetside. Operations on this stage depend onseed method- formysqldumpit's just uploading of .sql backup file to database, forxtrabackup- it's more complex process of uncompressing\preparing data in backup.ConnectSlave. Thisstagewill be executed completely byorchestrator. During thisstagetarget agentis connected as a slave forsource agent. But in order to implement this,orchestratorshould know position\gtids from backup. So it askstarget agentto providebackup metadataby callingGetMetadatamethod.Cleanup. Thisstageis executed on both sides,targetandsource. 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 --versioncommand to check availability ofxtrabackupbinary)getSupportedEngines()- returns an array of supported engines forseed method. We need this because differentseed methodssupports different engines, and we can't, for example, usextrabackupon MySQL 5.7 if there are tables withMyrocksengine, as they are not supportedbackupToDatadir()- is a helper function, which returns true in case of thisseed methodis capable of backing up data directly to mysql data directory (likextrabackup`cloneplugin`, 'lvm' - the do not create intermediate backup files with data)Stagesare exposed throughorchestrator-agentAPI andorchestratorcalls them in order.As each
stagecan 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 stageprogress via channel and this information is also exposed through API, soorchestratorcan call this API to be able to trackstageprogress.That is the basic overview of the process from the
orchestrator-agentside. All the philosophy is still the same as was - it's just exposes API calls to process seed and all logic is handled on theorchestratorside.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
betaright now.But I will be very grateful for your feedback and comments :)
Thanks,
Max