I wrote:
> I forgot to report back, but yesterday I spent time unsuccessfully
> trying to reproduce the problem with macOS client and NFS server
> using btrfs (a Synology NAS running some no-name version of Linux).
Also, I *can* reproduce it using the same NFS server and a FreeBSD
14.2 client. At least with this pair of machines, the behavior seems
deterministic: "createdb foo" followed by "dropdb foo" leaves the
same set of not-dropped files behind each time. I added a bit of
debug logging to rmtree.c and verified that it's not seeing anything
odd happening, except that readdir never returns anything about the
missed files.
I will file a bug report, unless you already did?
regards, tom lane