|
cipd: Implement local cache for ResolveVersion(...) call with tags.
Tags are not detachable. If ResolveVersion(<tag>) resolved to something, it is
guaranteed to resolve to the same thing later or not to resolve at all (in case
same <tag> was attached to another instance).
Tags that are applied to multiple instances aren't supposed to be used for
version resolution anyway.
So it seems acceptable to cache <tag> -> <instance id> mapping locally to avoid
round trip to the server next time it is used.
In practice same tag reresolution happens a lot. Puppet runs "cipd ensure" each
N minutes, passing cipd "pkg1:tag1 pkg2:tag2 ..." list where tags are mostly
static (compared to the frequency of puppet runs). No need to go to the backend
all the time. Especially considering it might not be available due to temporary
networks hiccups, etc.
I expect this CL will reduce QPS to the backed to ~0 compared to the current
state.
R=nodir@chromium.org, tandrii@chromium.org
BUG=
Committed: https://chromium.googlesource.com/infra/infra/+/72d3a5a5d8173d0a353d26ce307b96270355c77f
Total comments: 56
|
Unified diffs |
Side-by-side diffs |
Delta from patch set |
Stats (+595 lines, -39 lines) |
Patch |
 |
M |
go/src/infra/tools/cipd/apps/cipd/friendly.go
|
View
|
1
|
2 chunks |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
go/src/infra/tools/cipd/apps/cipd/main.go
|
View
|
1
2
3
|
9 chunks |
+9 lines, -0 lines |
0 comments
|
Download
|
 |
M |
go/src/infra/tools/cipd/client.go
|
View
|
1
2
3
|
8 chunks |
+142 lines, -35 lines |
0 comments
|
Download
|
 |
A |
go/src/infra/tools/cipd/internal/checksum.go
|
View
|
|
1 chunk |
+42 lines, -0 lines |
0 comments
|
Download
|
 |
A |
go/src/infra/tools/cipd/internal/checksum_test.go
|
View
|
1
2
|
1 chunk |
+45 lines, -0 lines |
0 comments
|
Download
|
 |
A + |
go/src/infra/tools/cipd/internal/internal.infra_testing
|
View
|
1
2
|
0 chunks |
+-1 lines, --1 lines |
0 comments
|
Download
|
 |
A + |
go/src/infra/tools/cipd/internal/messages/generate.go
|
View
|
|
1 chunk |
+4 lines, -4 lines |
0 comments
|
Download
|
 |
A + |
go/src/infra/tools/cipd/internal/messages/messages.infra_testing
|
View
|
1
2
|
0 chunks |
+-1 lines, --1 lines |
0 comments
|
Download
|
 |
A |
go/src/infra/tools/cipd/internal/messages/messages.proto
|
View
|
|
1 chunk |
+27 lines, -0 lines |
0 comments
|
Download
|
 |
A |
go/src/infra/tools/cipd/internal/messages/messages.pb.go
|
View
|
|
1 chunk |
+101 lines, -0 lines |
0 comments
|
Download
|
 |
A |
go/src/infra/tools/cipd/internal/tagcache.go
|
View
|
1
2
|
1 chunk |
+164 lines, -0 lines |
0 comments
|
Download
|
 |
A |
go/src/infra/tools/cipd/internal/tagcache_test.go
|
View
|
1
2
|
1 chunk |
+54 lines, -0 lines |
0 comments
|
Download
|
 |
M |
go/src/infra/tools/cipd/local/fs.go
|
View
|
|
1 chunk |
+0 lines, -2 lines |
0 comments
|
Download
|
Total messages: 14 (3 generated)
|