Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
migrations: track the latest log record seen in logtransfer #6641
Conversation
|
!!build!! |
reedobrien
approved these changes
Nov 30, 2016
LGTM. I am not familiar with the migration stuff. So you might want another set of eyes.
| @@ -127,6 +128,9 @@ func (c *Client) httpPost(modelUUID string, content io.ReadSeeker, endpoint, con | ||
| return nil | ||
| } | ||
| +// OpenLogTransferStream connects to the migration logtransfer | ||
| +// endpoint on the target controller and returns a stream that JSON | ||
| +// logs records can be fed into. The objects written should be params.LogRecords. |
babbageclunk
Nov 30, 2016
Member
:) That was a method I added in an earlier PR, but I realised I hadn't documented it.
|
!!build!! |
babbageclunk
added some commits
Nov 30, 2016
| + return &logTracker{tracker: state.NewLastSentLogTracker(st, st.ModelUUID(), "migration-logtransfer")} | ||
| +} | ||
| + | ||
| +type logTracker struct { |
mjs
Dec 1, 2016
Contributor
The tracker only works correctly as long as the logs are seen in order right?
I realise that this is probably the case but it might be worth documenting that around here.
babbageclunk
Dec 1, 2016
Member
Yeah - I could make it a high-water thing but that seems like overkill for this.
I'll mention that assumption in various places.
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
jujubot
merged commit 7f63dd6
into
juju:develop
Dec 1, 2016
babbageclunk
deleted the
babbageclunk:logtransfer-track
branch
Dec 1, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
babbageclunk commentedNov 30, 2016
The migration logtransfer endpoint now keeps track of the latest time it's seen to enable restarting the transfer if it's interrupted. The migrationtarget facade has a LatestLogTime method so the migrationmaster can specify the start time to the debug log endpoint.
The latest time is updated every two minutes of log records seen (so as not to spam the database), and when the connection is closed. This means that the log time will be up-to-date unless the target controller is killed for some reason.