Cannot recover when any changelog topic partition becomes empty (as a result of some retention policy)
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 30/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- kafka, python
調査の方向性
Start in faust/tables/recovery.py: the highwater and earliest-offset builders (around lines 387-404 and 655-713) and the standby consistency checks (around lines 492-526). Reproduce by recovering a changelog partition where low equals high, which makes high - 1 nonexistent. Done means recovery completes for both active and standby partitions on an empty changelog partition, with the consistency checks still valid after seeking.
索引モデルが issue の本文から書いたものです。
説明
Checklist
- I have included information about relevant versions
- I have verified that the issue persists when using the
masterbranch of Faust.
Steps to reproduce
- if a topic partition is not empty: low watermark = minimum/earliest available offset, high watermark = maximum/latest available offset +1
- if a topic partition is empty low watermark = high watermark
A changelog topic can become empty as a result of a Kafka cleanup policy (i.e., time/sized-based retention)
The case when the topic is empty is not handled properly in Faust recovery.
The recovery service needs to replay messages between low watermark (earliest offset) to high watermark - 1 (latest offset). Faust does this for the active and the standby partitions. Afterwards, it runs some consistency checks.
Active partitions
Let's start with the active partitions:
- Building highwaters for active partitions https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L387-L393
- https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L655-L664
If the partition is emptyhigh - 1does not exist, and the recovery will fail. There is even aFIXMEin building the highwaters. In my opinion, it would be better to also get the low watermarks and-1 if high is None or low == high else high - 1
- https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L655-L664
- Building earliest offsets for active partitions https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L396-L401
- Similarly, if the topic partition is empty
low - 1(offsetlowafter the +1 adjustment) would not exist https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L703-L713
In my opinion, this could beNone if offset is None else min(offset, highwaters.get(offset, offset))
- Similarly, if the topic partition is empty
Standby partitions
Moreover, recovering standby partitions has a separate issue in the consistency checks. First, let's see what is the sequence of steps for active partitions such that we can draw a parallel.
Active:
- Find latest/max offsets, min/earliest offsets, run consistency checks and seek to offset https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L387-L404
https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L425-L430
Standby:
- Find min/earliest offsets, seek to offsets, find max/latest offsets, run consistency checks
https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L417-L423
https://github.com/faust-streaming/faust/blob/6588a9774babd6aee61f2ce69572b167850717b4/faust/tables/recovery.py#L492-L526
The problem is that after seeking the offsets may be updated asynchronously so by the time the consistency checks run they may no longer hold.
- 主要言語
- Python
- スター
- 1.9k
- フォーク
- 205
- 平均マージ
- 2時間 2分
- マージ済み PR(30日)
- 1
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
faust-streaming/faust のほかの issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 86/100
faust-streaming/faust#804 ·
-
scripts/install script forces use of ./venv virtualenv, impossible to use with virtualenvwrapperオープン
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
faust-streaming/faust#28 · コメント 1 件 ·
-
[BUG] SASL PLAINTEXT producer initialization fails : missing sasl_plain_username/password対応中かも @wbarnha が 56 日前に担当しました。 オープン
faust-streaming/faust#794 · コメント 2 件 · リアクション 1 件 · 担当者 2 名 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
faust-streaming/faust#670 ·
-
難易度 4/5 3〜5日 初心者へのやさしさ 18/100
faust-streaming/faust#666 ·
faust-streaming/faust の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
[Maintainer] task area:visualizer
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
RailtownAI/railtracks#1824 ·
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
apache/datafusion#27688 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
heasarc/heasarc-tutorials#317 ·
-
bug good first issue help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
mloda-ai/mloda-registry#1664 ·
メンテナーはふだん 1 日以内に返信