Raw event cursors still count every repository's raw events

Đang mở
#80 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

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
40/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, postgresql, sql
Lĩnh vực
backend, database, security

Hướng nghiên cứu

Take #78's typed-event fix as the template — per-target counter, insert-lock trigger, per-target purge mark — because the raw path must mirror it. Read faucet/pgstore/queries/rawevents.sql:90 and :235 for the shared MAX(id) head, then the four call sites that surface it: faucet/rawpoll.go:190, faucet/rawsubscribe.go:167, faucet/rawdeliver.go:72 and :100. Reproduce the leak with a two-repository test before editing. Done when the four checks in the issue hold and an old r1. cursor restarts as truncated.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Raw event cursors still let a caller count other repositories' raw events and time their arrival. #78 fixed this for typed events only.

Raw events are off unless FAUCET_RAW_EVENTS is set, and production does not set it. docs/security.md already names this as a known gap. Fix it before anyone turns raw events on.

Where the shared number reaches a caller (main 157e81b)

All raw positions are faucet_raw_events.id, one sequence for every repository:

  • faucet/pgstore/queries/rawevents.sql:90 and :235: the head is MAX(id) over the whole table.
  • faucet/rawpoll.go:190: the events/poll cursor for a raw name (r1.<n> plus the lease).
  • faucet/rawsubscribe.go:167: the subscribe reply cursor.
  • faucet/rawdeliver.go:72 and :100: the push watermark and the raw gap cursor.

Suggested fix

Do what #78 did for typed events. Give each target its own count of raw events, assigned under the insert lock by a trigger so an old build keeps numbering during a rolling deploy. Give each target its own purge mark. Return only positions on the named target's count. Never translate an old r1. cursor: restart it as truncated.

Done when

The checks from #78 hold for raw names:

  • A reader of a quiet repository gets the same values whether or not other repositories receive raw events or get purged.
  • A maxAgeMs and cursor sweep gives the same answers with or without other repositories' traffic.
  • A resumed read skips and repeats nothing.
  • A hand-made cursor stays on the reader's own count.

Generated with xum • Model: anthropic:claude-opus-5-5 • Thinking: high

Ngôn ngữ chính
Go
Star
1
Fork
0
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của coder/faucet

Tất cả issue của coder/faucet

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.