[patch] Cache invalidation for I/O Workers

From: Alexandre Felipe <o(dot)alexandre(dot)felipe(at)gmail(dot)com>
To: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: [patch] Cache invalidation for I/O Workers
Date: 2026-09-18 16:01:37
Message-ID: CAE8JnxOivqBrwGz8jwnKnXJ5tBe6EU=71P31MBStY37MDZ=jng@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

This solves BUG #19622, from pgsql-bugs [1]

With io_method=worker I/O worker processes retain open file descriptors on
relation files that have been dropped.

When dropping a relation, an invalidation message is posted, backends handle it
this patch implements the same pattern in I/O worker, and prevents holding
invalid relations.

That said,

This issue doesn't have observable consequences to the user, and is
currently bound
by `max_files_per_process` (default 1000), after which it forces
closing the least
recently used files, if that parameter does its job, we wouldn't have a crash.

In the theoretical scenario of a relation number being reused it could
attempt to read
from a stale file.

https://www.postgresql.org/message-id/19622-639a4ba94c5a53d7%40postgresql.org

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Marko Grujic 2026-09-18 16:02:26 Temp schema drop leaves an inconsistent state behind
Previous Message Jacob Champion 2026-09-18 15:58:39 Re: Proposal: Supporting URI SAN in Certificate Authentication