Bound Azure Pipelines selector history and publish cost

未关闭
#164 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
冷清
技术栈
csharp
领域
tooling

调研方向

从 src/AzurePipelines/PipelineCachingCacheClient.cs 中的 GetSelectors(...).ToHashSetAsync 以及关于限制存储的 selector 数量的 TODO 开始。跟踪带时间戳的 selector key、manifest 和路径集下载的处理方式,然后为 selector 变化、去重、驱逐、有界的 manifest 大小以及远程请求添加测试。完成的标准是:保留和发布工作仍保持有界,同时保留的 selector 仍能提供预期的缓存命中。

由索引模型根据 Issue 内容生成。

描述

Summary

The Azure Pipelines cache backend carries forward every selector ever observed for a weak fingerprint and republishes the complete set on each new selector.

Impact

For a recurring weak fingerprint whose path set or strong selector changes over time, each miss fetches the prior selector manifest, downloads every unique historical path set, writes temporary files, and republishes the full set. Publish work grows linearly with selector history rather than remaining bounded. Azure retention and selector deduplication limit some scenarios, but a long-lived cache universe can still accumulate substantial sequential remote I/O.

Evidence

src/AzurePipelines/PipelineCachingCacheClient.cs calls GetSelectors(...).ToHashSetAsync, adds the current selector, then iterates all selectors and republishes them. The implementation already contains TODO: limit the number of selectors we store. Timestamped selector keys carry the newest set across builds.

Suggested fix

Introduce a bounded retention policy for selectors per weak fingerprint, preserving the most useful/recent entries. Avoid downloading historical path-set content that will not be retained. Add instrumentation or tests demonstrating bounded manifest size and remote requests.

Acceptance criteria

  • Selector count and manifest size remain bounded under repeated selector churn.
  • Existing selectors still provide expected cache hits within the retention policy.
  • Publishing a new selector performs bounded remote work.
  • Tests cover churn, deduplication, and eviction behavior.
主要语言
C#
星标
64
派生
24
平均合并
1 天 14 小时
30 天内合并 PR
2

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoft/MSBuildCache 的其他 Issue

查看 microsoft/MSBuildCache 的全部 Issue

相似的 Issue

更多 C# Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。