Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Ensure logTailer returns records in time order #6612
Conversation
|
Hmm, will this behave alright when there's an upgrade? I guess the first open post-upgrade will create the new index. Does there need to be something more explicit than this? |
babbageclunk
added some commits
Nov 24, 2016
|
!!build!! |
|
Doing a manual test of the upgrade now. |
|
Upgrade worked fine.
After:
|
|
Gah. Not sure about these tests checking the values of constants. |
|
!!build!! |
| + if err == nil { | ||
| + return nil | ||
| + } | ||
| + if queryErr, ok := err.(*mgo.QueryError); ok { |
mjs
Nov 25, 2016
Contributor
I was thinking you could check the output of Indexes() and then decide whether to drop, but this is fine too.
babbageclunk
Nov 25, 2016
Member
I had that at first, but this seemed less racy. Although it does depend on looking at the error message.
babbageclunk
added some commits
Nov 25, 2016
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
babbageclunk commentedNov 24, 2016
Having the separate sort by id worked by coincidence when records were
inserted in time order, but now that old records can be added by
migration the ids don't match up with times so records come back out of order.
Add id to the index instead and use one sort.
QA:
Deployed ubuntu to a new model
Noted the earliest log message for the model
Bootstrapped another controller
Migrated the model to the new controller
Checked that the earliest log message was the same