@app.table_route points to the wrong worker
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 22/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 停滞
- 技术栈
- docker, python
调研方向
Start by reproducing the bug with the linked sandbox repository (test-faust) using three workers and three partitions in Docker, then curl /info/D/ to confirm the wrong-worker response. The payload names only @app.table_route and the partition-owner lookup behind it, so the routing code has to be found from there. Done means the request reaches the worker that owns the key's active partition and the test reproduces that behavior. Expect it to need familiarity with Faust's table partition and standby handling.
由索引模型根据 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
Trying to use faust table view with 3 faust workers and 3 topics partitions with 1 Redpanda broker.
Please check my sandbox repository to view clearly what happen and how to precisely reproduce it with Docker!
In a nutshell, here is a dummy app, executed with TOPIC_PARTITIONS: 3 itself in 3 docker containers.
import faust
from faust.web import Request, Response, View
import os
app = faust.App( 'test',
broker=os.getenv("FAUST_BROKER_URL"),
topic_partitions=3
)
table = app.Table('info', key_type=str, value_type=str)
@app.agent(key_type=str, value_type=str, concurrency=1)
async def write_info(stream):
async for key, value in stream.items():
table[key] = value
yield
@app.page('/info/{key}/')
@app.table_route(table=table, match_info='key')
async def get_info(web, request: Request, key) -> Response:
try:
value = table[key]
return web.json(value)
except KeyError:
raise View.NotFound(f"Cannot find this symbol among [{table.keys()}]")
@app.page("/info")
class info(View):
async def get(self, request: Request) -> Response:
# Downloads infos
return self.json({symbol: value for symbol, value in table.items()})
async def post(self, request: Request) -> Response:
json_data = await request.json()
await write_info.cast(key=json_data['key'], value=json_data['value'])
return self.json({"message": f"Post {json_data['key']}"})
After populating the table info with A,B,C,D elements, the faust router not to seem working as expected.
$ curl localhost:6066/info/D/
$ {"error":"Cannot find this symbol among [dict_keys(['A', 'B', 'C'])]"}
Expected behavior
The routing points to the correct worker faust-2 which hold the active partition with the element D.
Actual behavior
The routing points to the worker faust-1 which hold the stand-by but correct partition 0.
Full traceback
Versions
- Python version : 3.11
- Faust version : 0.10.13
- Operating system : Linux
- Redpanda version : 23.3.11
- 主要语言
- Python
- 星标
- 1.9k
- 派生
- 205
- 平均合并
- 2 小时 2 分钟
- 30 天内合并 PR
- 1
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 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 个 reaction · 已指派 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 小时 新手友好度 62/100
OpenFreeEnergy/openfe#2371 ·
维护者通常 2 天内回复
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)未关闭
难度 2/5 1-3 小时 新手友好度 80/100
NCATSTranslator/Babel#1269 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 80/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100