Re: pg_resetwal tests, logging, and docs update

Peter Eisentraut <peter@eisentraut.org>

From: Peter Eisentraut <peter@eisentraut.org>
To: Aleksander Alekseev <aleksander@timescale.com>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-09-19T14:31:35Z
Lists: pgsql-hackers

Attachments

On 13.09.23 16:36, Aleksander Alekseev wrote:
> All in all the patch looks OK but I have a couple of nitpicks.
> 
> ```
> +   working on a data directory in an unclean shutdown state or with a corrupt
> +   control file.
> ```
> 
> ```
> +   After running this command on a data directory with corrupted WAL or a
> +   corrupt control file,
> ```
> 
> I'm not a native English speaker but shouldn't it be "corruptED control file"?

fixed

> 
> ```
> +      Force <command>pg_resetwal</command> to proceed even in situations where
> +      it could be dangerous,
> ```
> 
> "where" is probably fine but wouldn't "WHEN it could be dangerous" be better?

Hmm, I think I like "where" better.

Attached is an updated patch set where I have split the changes into 
smaller pieces.  The last two patches still have some open questions 
about what certain constants mean etc.  The other patches should be settled.

Commits

  1. doc: pg_resetwal: Add comments how the multipliers are derived

  2. pg_resetwal: Add more tests and test coverage

  3. More consistent behavior of GetDataDirectoryCreatePerm on Windows

  4. doc: Improve documentation about pg_resetwal -f option

  5. pg_resetwal: Use frontend logging API

  6. pg_resetwal: Regroup --help output

  7. pg_resetwal: Improve error with wrong/missing data directory

  8. pg_resetwal: Update an obsolete comment