Re: Volatile write caches on macOS and Windows, redux

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Volatile write caches on macOS and Windows, redux
Date: 2024-05-29 13:49:57
Message-ID: c0e6421d-8317-4cf0-b94b-d832b64265a5@eisentraut.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 25.05.24 04:01, Jelte Fennema-Nio wrote:
> Is this the only reason why you're suggesting adding fsync=full,
> instead of simply always setting F_FULLFSYNC when fsync=true on MacOS.
> If so, I'm not sure we really gain anything by this tri-state. I think
> people either care about data loss on power loss, or they don't. I
> doubt many people want his third intermediate option, which afaict
> basically means lose data on powerloss less often than fsync=false but
> still lose data most of the time.

I agree, two states should be enough. It could basically just be

pg_fsync(int fd)
{
#if macos
fcntl(fd, F_FULLFSYNC);
#else
fsync(fd);
#endif
}

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2024-05-29 15:56:12 Re: 001_rep_changes.pl fails due to publisher stuck on shutdown
Previous Message Alexander Korotkov 2024-05-29 12:53:39 Re: About 0001:,Having overviewed it, I don't see any issues (but I'm the author), except grammatical ones - but I'm not a native to judge it.,Also, the sentence 'turning GROUP BY clauses into pathkeys' is unclear to me. It may be better to write something like: 'building pathkeys by the list of grouping clauses'.,,0002:,The part under USE_ASSERT_CHECKING looks good to me. But the code in group_keys_reorder_by_pathkeys looks suspicious: of course, we do some doubtful work without any possible way to reproduce, but if we envision some duplicated elements in the group_clauses, we should avoid usage of the list_concat_unique_ptr. What's more, why do you not exit from foreach_ptr immediately after SortGroupClause has been found? I think the new_group_clauses should be consistent with the new_group_pathkeys.,,0003:,Looks good,,0004:,I was also thinking about reintroducing the preprocess_groupclause because with the re-arrangement of GROUP-BY clauses according to incoming pathkeys, it d...