@app.table_route points to the wrong worker
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 22/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- docker, python
- Lĩnh vực
- backend, distributed-systems
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 1.9k
- Fork
- 205
- Merge trung bình
- 2 giờ 2 phút
- Pull request đã merge (30 ngày)
- 1
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của faust-streaming/faust
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
faust-streaming/faust#804 ·
-
scripts/install script forces use of ./venv virtualenv, impossible to use with virtualenvwrapperĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 62/100
faust-streaming/faust#28 · 1 bình luận ·
-
[BUG] SASL PLAINTEXT producer initialization fails : missing sasl_plain_username/passwordCó thể đã có người làm @wbarnha đã nhận 56 ngày trước. Đang mở
faust-streaming/faust#794 · 2 bình luận · 1 reaction · 2 người được giao ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
faust-streaming/faust#670 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 18/100
faust-streaming/faust#666 ·
Tất cả issue của faust-streaming/faust
Issue tương tự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 1 ngày
-
[Maintainer] task area:visualizer
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
RailtownAI/railtracks#1824 ·
Maintainer thường phản hồi trong vòng 3 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
apache/datafusion#27688 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
heasarc/heasarc-tutorials#317 ·
-
bug good first issue help wanted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
mloda-ai/mloda-registry#1664 ·
Maintainer thường phản hồi trong vòng 1 ngày