You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When WAL failover is configured, a single logical WAL may be composed of
multiple physical segment files. The creation of these physical segment files
occurs asynchronously. This asynchronous creation may race with the closing of
the failover writer.
Specifically, an outstanding attempt to create a segment file may block.
Meanwhile, writes persisting all the necessary records may complete on the
other device. If the logical WAL is now finished, the failover writer may be
closed by higher-level code while the outstanding attempt to create a file
remains. The system progresses, accumulating a list of obsolete files based on
the set that existed at the time that the writer was closed. Eventually, the
outstanding file creation may complete, creating a new file.
Previously this race resulted in leaking the straggling file. Because we
preallocate disk space for WAL files, this logically empty file could still
consume significant disk space. This leaked file could not be discovered and
deleted until process restart.
This commit adjusts the FailoverWriter to invoke a callback on the
FailoverManager, propagating information about these abandoned segment files.
This allows the FailoverManager to propagate these obsolete files to higher
levels for deletion.
Fix#5355.
0 commit comments