|
|
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
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:
Total messages: 13 (6 generated)
|