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

Issue 2435883002: LogDog: Fix archival Get/Tail implementations. (Closed)

Created:
4 years, 2 months ago by dnj
Modified:
4 years, 1 month ago
Reviewers:
Vadim Sh., nodir
CC:
chromium-reviews, infra-reviews+luci-go_chromium.org, andrew.wang, todd, tandrii+luci-go_chromium.org, M-A Ruel
Target Ref:
refs/heads/master
Project:
luci-go
Visibility:
Public.

Description

LogDog: Fix archival Get/Tail implementations. The sparse index tail algorithm assumed that indexes always had an entry for the last log in the index. This is not necessarily true for sparse indexes. Consequently, archive Tail could return a non-tail entry in that situation. This also fixes the Get and Tail to be more robust against malformed index and stream data files, to the point where it will happily operate without an index if needed now. However, this is actually a good idea, so update index generation to always include a final entry to the index. Tail optimizes for this case. This introduced yet another situation where the storage layer was unmarshalling LogEntry protobufs, then passing the binary data up to the higher level to unmarshal again! To prevent this from introducing performance regressions, we now have the storage layer kick up a lazy unmarshal-at-most-once struct instead of raw data. This will let higher levels take advantage of storage layers that have to unmarshal protobufs. Finally, log archival fetching had no supporting unit tests. Write some, with very high coverage. TBR=nodir@chromium.org BUG=chromium:654880 TEST=unit Committed: https://github.com/luci/luci-go/commit/d65c2b2a5ebadb3ebfa0383630bbc1fa2b755a70

Patch Set 1 : LogDog: Fix archival Get/Tail implementations. #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+852 lines, -287 lines) Patch
M common/iotools/countingreader.go View 4 chunks +4 lines, -9 lines 1 comment Download
M common/iotools/countingreader_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
M logdog/appengine/coordinator/endpoints/logs/get.go View 9 chunks +31 lines, -29 lines 3 comments Download
M logdog/appengine/coordinator/endpoints/logs/get_test.go View 1 chunk +1 line, -1 line 0 comments Download
M logdog/client/butler/streamserver/handshake.go View 1 chunk +2 lines, -2 lines 0 comments Download
M logdog/common/archive/archive.go View 1 chunk +2 lines, -1 line 0 comments Download
M logdog/common/archive/archive_test.go View 3 chunks +3 lines, -3 lines 0 comments Download
M logdog/common/archive/index.go View 3 chunks +19 lines, -8 lines 0 comments Download
M logdog/common/storage/archive/logdog_archive_test/main.go View 3 chunks +26 lines, -13 lines 0 comments Download
M logdog/common/storage/archive/storage.go View 7 chunks +245 lines, -175 lines 1 comment Download
A logdog/common/storage/archive/storage_test.go View 1 chunk +368 lines, -0 lines 0 comments Download
M logdog/common/storage/bigtable/storage.go View 4 chunks +4 lines, -4 lines 0 comments Download
M logdog/common/storage/bigtable/storage_test.go View 3 chunks +16 lines, -5 lines 0 comments Download
A logdog/common/storage/entry.go View 1 chunk +77 lines, -0 lines 0 comments Download
M logdog/common/storage/memory/memory.go View 3 chunks +4 lines, -4 lines 0 comments Download
M logdog/common/storage/memory/memory_test.go View 4 chunks +18 lines, -10 lines 0 comments Download
M logdog/common/storage/storage.go View 3 chunks +11 lines, -4 lines 0 comments Download
M logdog/server/archivist/archivist.go View 1 chunk +7 lines, -1 line 0 comments Download
M logdog/server/archivist/storageSource.go View 2 chunks +6 lines, -10 lines 0 comments Download
M logdog/server/collector/utils_test.go View 3 chunks +5 lines, -5 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 13 (6 generated)
dnj
https://codereview.chromium.org/2435883002/diff/20001/common/iotools/countingreader.go File common/iotools/countingreader.go (right): https://codereview.chromium.org/2435883002/diff/20001/common/iotools/countingreader.go#newcode15 common/iotools/countingreader.go:15: Count int64 This is trivial enough that I don't ...
4 years, 2 months ago (2016-10-19 23:18:59 UTC) #2
dnj
PTAL. Just throwing this out b/c I have to run for the day, LMK if ...
4 years, 2 months ago (2016-10-20 18:40:12 UTC) #4
dnj
I don't think anyone actually cares about this CL set, and the tests show that ...
4 years, 1 month ago (2016-10-26 17:34:09 UTC) #6
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2435883002/20001
4 years, 1 month ago (2016-10-26 17:34:17 UTC) #8
commit-bot: I haz the power
Committed patchset #1 (id:20001) as https://github.com/luci/luci-go/commit/d65c2b2a5ebadb3ebfa0383630bbc1fa2b755a70
4 years, 1 month ago (2016-10-26 18:20:52 UTC) #10
nodir
https://codereview.chromium.org/2435883002/diff/20001/logdog/appengine/coordinator/endpoints/logs/get.go File logdog/appengine/coordinator/endpoints/logs/get.go (right): https://codereview.chromium.org/2435883002/diff/20001/logdog/appengine/coordinator/endpoints/logs/get.go#newcode237 logdog/appengine/coordinator/endpoints/logs/get.go:237: byteLimit -= len(e.D) you are mutating byteLimit in a ...
4 years, 1 month ago (2016-10-26 20:25:33 UTC) #12
nodir
4 years, 1 month ago (2016-10-26 21:46:42 UTC) #13
Message was sent while issue was closed.
lgtm

Powered by Google App Engine
This is Rietveld 408576698