Tracking: a retried event is stored twice, so revenue and count metrics double-count it
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 15/100
調査の方向性
Start with the event request schema in backend/app/schemas/tracking.py (around line 392), the events table in backend/app/models/event.py (lines 126-138), and the metric queries in AnalysisService.value_totals and event_counts in backend/app/services/analysis_service.py. The approach is not decided yet, so first get a maintainer decision on the event-id design. Done would mean a regression test that posts the same purchase twice to /track and shows revenue per user counts it once.
索引モデルが issue の本文から書いたものです。
説明
What happens
POST /api/v1/tracking/track and POST /api/v1/tracking/batch store every event they receive, and nothing identifies an event across requests:
EventRequest(backend/app/schemas/tracking.py:392) has no event-id field;events.idis generated by the server;- the
eventstable has plain indexes only, with no unique constraint (backend/app/models/event.py:126-138).
So a client that retries after a timeout stores the event twice whenever the first request was in fact stored.
What it changes in results
- Revenue metrics sum
Event.valueper user (AnalysisService.value_totals,backend/app/services/analysis_service.py:311), so a retried purchase counts twice. - Count metrics count every stored event (
AnalysisService.event_counts,analysis_service.py:276), so they double too. - Conversion rates are unaffected, because they count distinct users.
- Assignments are unaffected, because
/assignis idempotent through the unique(experiment_id, user_id)index.
The error isn't the same in both arms. The arm whose clients retry more, for example a slower variant, gets more duplicates, which biases the comparison and doesn't just add noise.
Evidence
Read in the code at main d48e06c. It has not been reproduced by a run yet. The fix's regression test should do that: send the same purchase twice through /track, and check that revenue per user counts it once.
Direction (to be planned, not decided)
The usual pattern is an optional event id supplied by the client, deduplicated per user, in the manner of an idempotency key. That needs a migration, an API contract change and SDK changes, so it goes through the full process. It is also the first fault scenario for the ground-truth replay tests in #1544.
- 主要言語
- Python
- スター
- 0
- フォーク
- 4
- 平均マージ
- 5時間 36分
- マージ済み PR(30日)
- 509
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
Controlvar/controlvar のほかの issue
-
bug post-launch
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Controlvar/controlvar#1748 ·
メンテナーはふだん 1 日以内に返信
-
Dashboard: the sequential panel's "Ready to stop" banner shows no sample-ratio-mismatch cautionオープンbug post-launch
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
Controlvar/controlvar#1737 ·
メンテナーはふだん 1 日以内に返信
-
bug post-launch
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Controlvar/controlvar#1562 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 90/100
Controlvar/controlvar#1447 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
Experiment setup: emptying a traffic share box and typing a number shows a leading zero ("034")オープンbug post-launch
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
Controlvar/controlvar#1428 ·
メンテナーはふだん 1 日以内に返信
Controlvar/controlvar の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
didi/helixharness#18 ·
-
request-theme
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
LizardByte/ThemerrDB#9883 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
NousResearch/hermes-agent#149885 ·
メンテナーはふだん 1 日以内に返信
-
Set cache_ok = True on GUID TypeDecorator to enable SQLAlchemy query caching対応中かも @patelshivani2283-lab が今日担当しました。 オープン
難易度 1/5 1時間未満 初心者へのやさしさ 91/100
fedora-infra/anitya#2157 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
Project-MONAI/MONAI#9258 ·
メンテナーはふだん 3 日以内に返信