-
Notifications
You must be signed in to change notification settings - Fork 61
Don't fetch Snapshot or Targets metadata if we already have the latest. #1503
Conversation
Rebased version here for reference: https://github.com/advancedtelematic/aktualizr/tree/feat/OTA-3995/dont-download-redundantly-rebased |
Thanks! I'm just getting back from holidays and have only glanced at this. One thing I was wondering - would it be a worth a LOG_DEBUG when skipping a remote fetch, or is this pretty easy to detect based on the current logging (ie no HTTP_GET is done, so it got skipped)? |
FYI the standard has been updated accordingly to acknowledge (most of) these optimizations: uptane/uptane-standard#151 |
515b2fb
to
d9494ee
Compare
Codecov Report
@@ Coverage Diff @@
## master #1503 +/- ##
==========================================
+ Coverage 80.74% 80.76% +0.02%
==========================================
Files 184 184
Lines 11141 11154 +13
==========================================
+ Hits 8996 9009 +13
Misses 2145 2145
Continue to review full report at Codecov.
|
Rebased on latest master.
@doanac I think it's easy enough to determine with loglevel 1 from watching the GETs (not) made. |
Looking good! @doanac's comment is still valid though, adding a |
Also test that we don't fetch anything from the Image repo if the Director does not indicate that there are updates. Signed-off-by: Patrick Vacek <[email protected]>
d9494ee
to
b4537ee
Compare
Two votes is enough to convince me. Done. |
Also test that we don't fetch anything from the Image repo if the Director does not indicate that there are updates.
This should probably wait until #1501 is merged, since that will change how root metadata is fetched.I did some manual testing to verify that the bandwidth savings are real. Note that my account has a rather large
targets.json
in the Image repo, so this demonstrates it well. I did a rather naive comparison by counting the bytes dumped to the log for each server response. (This is flawed for many reasons but should still give a reasonable idea of the benefit.) I did this three times: once for initialization (no updates, only Director metadata fetched), again for an update (all metadata fetched), and a third time for a second, pre-existing update (all metadata fetched on master, but with this PR, the Snapshot and Targets from the Image repo are skipped).On current master:
With these changes:
FYI @doanac this hopefully helps address #1446.