Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Issue 1904503003: LogDog: Fix archived log stream read errors. (Closed)

Created:
4 years, 8 months ago by dnj
Modified:
4 years, 8 months ago
Reviewers:
Vadim Sh., estaab, nodir
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, andrew.wang, todd, tandrii+luci-go_chromium.org, M-A Ruel
Base URL:
https://github.com/luci/luci-go@hierarchy-check-first
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

LogDog: Fix archived log stream read errors. Fix some bugs in LogDog and associated libraries that prevented reading very large Google Storage archived streams. Fundamentally, Google Storage reads were not upper-bounded, despite the fact that we had the information to do so. This caused (minimally) more data than necessary to be fetched for a given request, and (in this case) a request to be issued that exceeded GAE's `urlfetch` upper bound, 32MB. We fix this by updating the archive log storage instance to calculate an upper offset when requesting log stream ranges. This exposed a bug in Google Storage library, where "from" and "to" parameters (absolute byte offsets) were being translated to "offset" and "length" parameters (with "length" relative to "offset"). This is fixed by explicitly standardizing on offset/length. Some `logs.Get` endpoint tests constrain byte count. Because we're now specifying upper bound, this caused them to return fewer logs than expected because the byte count being applied didn't include the RecordIO frame size. We fix this by calculating the frame size and factoring that into the byte range requests. BUG=chromium:604610 TEST=live - Deployed to afflicted system, verified that log stream is now functional. Committed: https://github.com/luci/luci-go/commit/1ec9fb582858f2063f64030370c9912b518726f6

Patch Set 1 #

Total comments: 20

Patch Set 2 : Fix nits. #

Patch Set 3 : Panic on invalid offset. #

Patch Set 4 : Delete "offset()" method. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+479 lines, -339 lines) Patch
M appengine/logdog/coordinator/endpoints/logs/get.go View 8 chunks +26 lines, -11 lines 0 comments Download
M appengine/logdog/coordinator/endpoints/logs/get_test.go View 6 chunks +305 lines, -286 lines 0 comments Download
M common/gcloud/gs/gs.go View 1 2 3 chunks +9 lines, -21 lines 0 comments Download
A common/recordio/size.go View 1 chunk +18 lines, -0 lines 0 comments Download
A common/recordio/size_test.go View 1 1 chunk +43 lines, -0 lines 0 comments Download
M server/logdog/storage/archive/storage.go View 1 2 3 7 chunks +78 lines, -21 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 15 (4 generated)
dnj
+vadimsh@, nodir@, could one of you please review? +estaab@ FYI, since it's your bug :)
4 years, 8 months ago (2016-04-19 21:54:49 UTC) #2
nodir
https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go File common/gcloud/gs/gs.go (right): https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go#newcode42 common/gcloud/gs/gs.go:42: // is <0, no upper byte bound will be ...
4 years, 8 months ago (2016-04-19 23:41:17 UTC) #3
dnj
https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go File common/gcloud/gs/gs.go (right): https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go#newcode42 common/gcloud/gs/gs.go:42: // is <0, no upper byte bound will be ...
4 years, 8 months ago (2016-04-20 00:45:07 UTC) #4
nodir
https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go File common/gcloud/gs/gs.go (right): https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go#newcode42 common/gcloud/gs/gs.go:42: // is <0, no upper byte bound will be ...
4 years, 8 months ago (2016-04-20 16:42:57 UTC) #5
dnj
https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go File common/gcloud/gs/gs.go (right): https://codereview.chromium.org/1904503003/diff/1/common/gcloud/gs/gs.go#newcode42 common/gcloud/gs/gs.go:42: // is <0, no upper byte bound will be ...
4 years, 8 months ago (2016-04-20 17:07:25 UTC) #6
dnj
https://codereview.chromium.org/1904503003/diff/1/server/logdog/storage/archive/storage.go File server/logdog/storage/archive/storage.go (right): https://codereview.chromium.org/1904503003/diff/1/server/logdog/storage/archive/storage.go#newcode122 server/logdog/storage/archive/storage.go:122: offset := int64(st.startOffset) On 2016/04/20 17:07:25, dnj wrote: > ...
4 years, 8 months ago (2016-04-20 17:08:41 UTC) #8
nodir
https://codereview.chromium.org/1904503003/diff/1/server/logdog/storage/archive/storage.go File server/logdog/storage/archive/storage.go (right): https://codereview.chromium.org/1904503003/diff/1/server/logdog/storage/archive/storage.go#newcode122 server/logdog/storage/archive/storage.go:122: offset := int64(st.startOffset) On 2016/04/20 17:07:25, dnj wrote: > ...
4 years, 8 months ago (2016-04-20 17:09:48 UTC) #9
dnj
https://codereview.chromium.org/1904503003/diff/1/server/logdog/storage/archive/storage.go File server/logdog/storage/archive/storage.go (right): https://codereview.chromium.org/1904503003/diff/1/server/logdog/storage/archive/storage.go#newcode122 server/logdog/storage/archive/storage.go:122: offset := int64(st.startOffset) On 2016/04/20 17:09:48, nodir wrote: > ...
4 years, 8 months ago (2016-04-20 17:16:14 UTC) #10
nodir
lgtm
4 years, 8 months ago (2016-04-20 17:17:17 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1904503003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1904503003/60001
4 years, 8 months ago (2016-04-20 19:30:31 UTC) #13
commit-bot: I haz the power
4 years, 8 months ago (2016-04-20 19:35:08 UTC) #15
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as
https://github.com/luci/luci-go/commit/1ec9fb582858f2063f64030370c9912b518726f6

Powered by Google App Engine
This is Rietveld 408576698