This perhaps is not the best fix, but it's better than the current
situation of failing after a few commits.
This issue appeared after
0dc8ead46, but only because before that
change fd leakage was limited to a single file descriptor.
Discussion: https://postgr.es/m/
20200406025651[email protected]
{
int block_id;
+ if (state->seg.ws_file != -1)
+ close(state->seg.ws_file);
+
for (block_id = 0; block_id <= XLR_MAX_BLOCK_ID; block_id++)
{
if (state->blocks[block_id].data)