Skip to content

Deadlock re-mask still sends raw-graph hashes as bind parameters, which log_min_duration_statement writes into the store's own log #4035

Closed

Description

@erikdarlingdata

Found while fixing #4012's review (finding 6), in the PR that follows up #4022.

What is left

That PR stops the deadlock re-mask from sending a row's raw TEXT back to the store as a bind parameter: the alert and finding writes now check the row by xmin, and the report write by the raw-hash test alone. Raw-graph HASHES still travel as bind parameters in three places in PgDeadlockRemask:

  • ReportPageSql's cursor ($3, the last row's deadlock_hash);
  • ReportUpdateSql's key ($2, the report's raw hash);
  • AlertReportLookupSql's key array ($2, the raw hashes the alerts name).

With log_min_duration_statement set on the store, a slow statement's parameters land in the store's own log. A raw-graph hash is a test for the literals #4004 removed, so the store log would hold that test for a while after the rows themselves no longer do.

What a fix needs to decide

  • The report walk needs a total order that does not include the hash (collection_time, server_id plus something stable on a compressed chunk).
  • The alert lookup could be done in SQL from context_json itself, so the keys never leave the store.
  • Whether it is worth it: the rows being rewritten still hold the same hash until the walk reaches them, and the pass finishes within hours on a measured 120k-row store.

Activity

  1. added
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Sep 23, 2026
  2. erikdarlingdata commented on Sep 23, 2026

    @erikdarlingdata
    OwnerAuthor

    Disposition (backtrack of #3898-#4043, 2026-09-23): work order 1 of 6, tier 1 (security). Folded into #4036 (draft): the re-mask no longer sends any raw-graph hash as a bind parameter. Compressed chunks refuse ctid/xmin, so the walk pages by (collection_time, server_id) and looks the raw hash up inside the store. The final security review round is running; this closes when #4036 merges.

  3. erikdarlingdata commented on Sep 23, 2026

    @erikdarlingdata
    OwnerAuthor

    Closed by the watcher: delivered in PR #4036, merged to dev.

  4. removed
    in-progressActively being worked by a local session or its agents (PR open or in flight)
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions