Closed
Bug 972100
Opened 9 years ago
Closed 9 years ago
Sync is making an additional info/collections request
Categories
(Firefox :: Sync, defect, P2)
Tracking
()
VERIFIED
FIXED
mozilla32
People
(Reporter: rnewman, Assigned: markh)
References
Details
(Whiteboard: [qa!])
Attachments
(2 files)
It *should* fetch i/c, then m/g, then crypto/keys, then each collection. Instead, it's fetching i/c, m/g, i/c, c/k, i/c, m/g, i/c, i/c, m/g, then each collection. Log attached. Testing on 2014-02-10 Nightly. Can someone else verify this? It'll have some perf impact and perhaps consistency problems if it's reproducible, and if it's not it's weird.
Updated•9 years ago
|
Whiteboard: [qa+]
Assignee | ||
Comment 1•9 years ago
|
||
(In reply to Richard Newman [:rnewman] from comment #0) > Can someone else verify this? Kinda :) What I see is the following: https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/info/collections - sync started, verifyLogin does: this.resource(this.infoURL).get(); https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/storage/meta/global https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/info/collections -> still in verifyLogin - this._remoteSetup() https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/storage/crypto/keys https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/info/collections - EngineSynchronizer.sync() https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/storage/meta/global https://sync-1-us-east-1.sync.services.mozilla.com/1.5/42871/storage/clients?full=1 And best I can tell, that's actually the least the code can do. Somewhat strangely, verifyLogin causes 2 such calls - one via an explicit fetch of this.infoURL, and the other via _remoteSetup() - I say "strangely" as _remoteSetup() takes an optional param which is an infoResponse, but verifyLogin() doesn't pass it even though it has that response - see the attached patch. For the first sync in your log, I see: https://sync-2-us-east-1.sync.services.mozilla.com/1.5/17300/info/collections - wrong UID - bug 973749 https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/info/collections - worked - verifyLogin doing .get https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/storage/meta/global https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/info/collections - verifyLogin calling this._remoteSetup https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/storage/crypto/keys https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/info/collections - EngineSynchronizer.sync() https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/storage/meta/global // and here things also differ from mine: // 1392251257400 Sync.Service INFO Sync IDs differ. Local is OoPwx_ycqEJi, remote is V852tSwDKqmp // The line above is causing us to do *another* verifyLogin, which as above, causes 2 /collections requests https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/info/collections https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/info/collections // and then it looks like mine. https://sync-1-us-east-1.sync.services.mozilla.com/1.5/17291/storage/meta/global This attachment prevents verifyLogin causing 2 such requests - any thoughts on that? Also, any insights into exactly what "Sync IDs differ." mean? I *guess* it has to do with syncing via a different user, which your log implies did actually happen - in which case this sounds "normal"...
Attachment #8378094 -
Flags: feedback?(rnewman)
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → mhammond
Reporter | ||
Comment 2•9 years ago
|
||
Comment on attachment 8378094 [details] [diff] [review] Pass the info response to _remoteSetup Review of attachment 8378094 [details] [diff] [review]: ----------------------------------------------------------------- This implies that a fat swath of code hasn't been exercised for a very long time. Before this lands we need to make sure that this clause: // Checking modified time of the meta record. if (infoResponse && works. Other than that, you win the "putting the chalk cross in the right place" award!
Attachment #8378094 -
Flags: feedback?(rnewman) → feedback+
Assignee | ||
Comment 3•9 years ago
|
||
Comment on attachment 8378094 [details] [diff] [review] Pass the info response to _remoteSetup Review of attachment 8378094 [details] [diff] [review]: ----------------------------------------------------------------- > Before this lands we need to make sure that this clause: > // Checking modified time of the meta record. > if (infoResponse && This appears to have test coverage via test_service_sync_remoteSetup.js - although remoteSetup() isn't directly called with an info response via that test, the test arranges to take every branch in the block in question - ie, during that test it both enters and does not enter the block: if (infoResponse && (infoResponse.obj.meta != this.metaModified) && (!meta || !meta.isNew)) { Inside that block it also takes both paths in the inner condition: if (!this.recordManager.response.success || !newMeta) { Is there some other explicit testing necessary? Requesting review on the off-chance these tests are already suitable :)
Attachment #8378094 -
Flags: review?(rnewman)
Reporter | ||
Comment 4•9 years ago
|
||
(In reply to Mark Hammond [:markh] from comment #3) > Is there some other explicit testing necessary? Requesting review on the > off-chance these tests are already suitable :) Is TPS working yet? (Even if only for Sync 1.1.) Scenarios that need testing: * Routine syncing * Sync, then upload a new meta/global remotely, then sync again * Sync such that meta/global needs to be changed at the end of the sync (enable new engine?), then sync again. Not easy to test the failure cases, alas.
Updated•9 years ago
|
Priority: -- → P1
Reporter | ||
Comment 5•9 years ago
|
||
Comment on attachment 8378094 [details] [diff] [review] Pass the info response to _remoteSetup Review of attachment 8378094 [details] [diff] [review]: ----------------------------------------------------------------- I'm going to r+ this, but we *must* have QA do manual testing here before uplift or merge. Even TPS won't adequately cover these cases.
Attachment #8378094 -
Flags: review?(rnewman) → review+
Comment 6•9 years ago
|
||
Adding some QA to look at this: General: edwong Desktop: tracy Android: AaronMT
Assignee | ||
Comment 7•9 years ago
|
||
Thanks! https://hg.mozilla.org/integration/fx-team/rev/8b98e1dc7ef3
Status: NEW → ASSIGNED
Comment 8•9 years ago
|
||
Backed out in https://hg.mozilla.org/integration/fx-team/rev/ebcf116fae8d for https://tbpl.mozilla.org/php/getParsedLog.php?id=35575476&tree=Fx-Team etc.
Reporter | ||
Comment 9•9 years ago
|
||
markh, remember to run xpcshell-test before landing stuff ;P Looking at that log: 21:10:52 INFO - Sync.Service DEBUG Caching URLs under storage user base: http://localhost:54222/1.1/johndoe/ 21:10:52 INFO - Sync.Test.Server DEBUG SyncServer: Handling request: GET /1.1/johndoe/info/collections 21:10:52 INFO - Sync.Resource DEBUG mesg: GET success 200 http://localhost:54222/1.1/johndoe/info/collections 21:10:52 INFO - Sync.Resource DEBUG GET success 200 http://localhost:54222/1.1/johndoe/info/collections 21:10:52 INFO - Sync.Service DEBUG Fetching global metadata record 21:10:52 INFO - Sync.Test.Server DEBUG SyncServer: Handling request: GET /1.1/johndoe/storage/meta/global 21:10:52 INFO - Sync.Resource DEBUG mesg: GET fail 401 http://localhost:54222/1.1/johndoe/storage/meta/global 21:10:52 INFO - Sync.Resource DEBUG GET fail 401 http://localhost:54222/1.1/johndoe/storage/meta/global 21:10:52 INFO - Sync.Service DEBUG Clearing cached meta record. metaModified is 1393909850.75, setting to undefined 21:10:52 INFO - Sync.Test.Server DEBUG SyncServer: Handling request: GET /1.1/johndoe/storage/meta/global 21:10:52 INFO - Sync.Resource DEBUG mesg: GET fail 401 http://localhost:54222/1.1/johndoe/storage/meta/global 21:10:52 INFO - Sync.Resource DEBUG GET fail 401 http://localhost:54222/1.1/johndoe/storage/meta/global This shouldn't occur. If we get a 401 during a sync, it's not just a failure, it's an auth failure, and we shouldn't just clear the cache and try again. 21:10:52 INFO - Sync.Service DEBUG No meta/global record on the server. Creating one. 21:10:52 INFO - Sync.Resource DEBUG PUT Length: 78 ... and this is definitely not the right response to a 401! If the FxA code is doing the same thing -- and it probably is -- then we'll be doing really nutty things in response to clock skew errors. File a separate bug, Mark?
Comment 10•9 years ago
|
||
Is there an update here?
Updated•9 years ago
|
Priority: P1 → P2
Assignee | ||
Comment 11•9 years ago
|
||
I think we've determined it is only 1 additional request, but we might as well try and help services out by getting this fixed for 30.
status-firefox29:
--- → wontfix
status-firefox30:
--- → affected
tracking-firefox30:
--- → ?
Summary: Sync is making an insane number of info/collections and meta/global requests → Sync is making an additional info/collections request
Assignee | ||
Comment 12•9 years ago
|
||
hrmph - new try with the exact same patch worked: https://tbpl.mozilla.org/?tree=Try&rev=66469d959a44. Henrik, are you able to run TPS with this patch and ensure it doesn't cause problems in that environment?
Flags: needinfo?(hskupin)
Updated•9 years ago
|
Attachment #8375205 -
Attachment mime type: text/x-log → text/plain
Flags: needinfo?(hskupin)
Comment 13•9 years ago
|
||
I don't know all the details about this patch and the underlying sync code, but checking the trace output while running tps tests all is looking fine to me. I don't see any major breakage beside the usual intermittent failures we still have.
Assignee | ||
Comment 14•9 years ago
|
||
Thanks Henri - so given that and the green try... https://hg.mozilla.org/integration/fx-team/rev/0a127bfc0c74
Comment 15•9 years ago
|
||
https://hg.mozilla.org/mozilla-central/rev/0a127bfc0c74
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla32
Comment 16•9 years ago
|
||
Ok if this is still wanted for uplift all the way to Beta, let's make sure we have some QA on it first - Tracy, Aaron, edwong again as per comment 6
status-firefox31:
--- → affected
status-firefox32:
--- → fixed
tracking-firefox31:
--- → +
Flags: needinfo?(twalker)
Flags: needinfo?(edwong)
Flags: needinfo?(aaron.train)
Assignee | ||
Comment 17•9 years ago
|
||
(In reply to Lukas Blakk [:lsblakk] from comment #16) > Ok if this is still wanted for uplift all the way to Beta, let's make sure > we have some QA on it first - Tracy, Aaron, edwong again as per comment 6 TBH I think it would be fine if this only made it to 31 - its not a user-visible bug.
Comment 18•9 years ago
|
||
Aaron and Tracy, if ya'll could do some smoke testing on this... I'll do a sweep on Mac Fx Nightly as well.
Comment 19•9 years ago
|
||
Note: as per comment #4, the failure case is not easy to test. I ran the scenarios in comment #4. No issues.Given that and comment #13, marking this verified.
Status: RESOLVED → VERIFIED
Updated•9 years ago
|
Flags: needinfo?(twalker)
Comment 20•9 years ago
|
||
User impact description in bug 972100 comment 17 suggests we don't need to track this. We can still uplift given an approval request.
Comment 21•9 years ago
|
||
Karl, can you take do some smoke testing on android nightly, verify this as fixed, then we can uplift this.
Flags: needinfo?(kthiessen)
Flags: needinfo?(edwong)
Flags: needinfo?(aaron.train)
Comment 22•9 years ago
|
||
I will smoke test this on Android Nightly today.
Updated•9 years ago
|
Flags: needinfo?(kthiessen)
Comment 23•9 years ago
|
||
Parts of this are really difficult to test. However, with the same caveats that :tracy expressed in comment #19, I think this is ready to go.
Updated•5 years ago
|
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in
before you can comment on or make changes to this bug.
Description
•