Raw event cursors still count every repository's raw events

Offen
#80 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
40/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
go, postgresql, sql

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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

Vorherrschende Sprache
Go
Sterne
1
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus coder/faucet

Alle Issues in coder/faucet

Ähnliche Issues

Weitere Issues zu Go

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.