Alternative approach to partial tile cleanup for remote S3 buckets

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

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
需要澄清
活跃度
停滞
技术栈
go
领域
backend, cloud

调研方向

该 issue 没有指定任何仓库文件或测试;请先定位现有的部分 tile 清理入口点,并将其与链接的 Azul pull request 进行比较。在编码之前,先明确该项目是否需要分块、基于 checkpoint 的行为,然后定义安全推进清理的完成标准和测试。

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

描述

First off, thanks for writing partial-aftersun! I added partial tile cleanup in Azul and this was a huge help. However, I ended up taking a slightly different approach in the Azul implementation (https://github.com/cloudflare/azul/pull/59), so thought I'd post in case it's useful for other log operators.

Each time partial-aftersun runs it recurses though the entire directory looking for partial tiles to delete, and then deletes them if the safety checks pass. This runs as one big job and progress doesn't get saved, so you have to restart from the beginning each time.

I didn't see a way for this approach to work in the Azul/Workers implementation (mostly due to subrequest limits trying to iterate over an R2 bucket), so I adopted an iterative approach that could be run as many small jobs. Instead of recursing over files in the directory, the Azul partial tile cleaner iterates in chunks over leaf indexes from the last "cleaned" log size (initially zero) to the latest checkpoint tree size and generates the list of full tiles that must exist given the current tree size. Then, it just lists and deletes any partial tiles corresponding to those full tiles. This ended up being pretty fast and still hits all the safety checks in partial-aftersun.

主要语言
Go
星标
318
派生
32
PR 合并指标
30 天内没有已合并 PR

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

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

FiloSottile/sunlight 的其他 Issue

查看 FiloSottile/sunlight 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

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