https://bugs.openldap.org/show_bug.cgi?id=10454
--- Comment #3 from kero renault.cle@gmail.com --- Created attachment 1146 --> https://bugs.openldap.org/attachment.cgi?id=1146&action=edit correct-fdatasync-macos
It seems to me that env->me_mfd is never opened when MDB_WRITEMAP is used, which is the source of the problem.
if (!(flags & (MDB_RDONLY|MDB_WRITEMAP))) { rc = mdb_fopen(env, &fname, MDB_O_META, mode, &env->me_mfd);
I propose a patch to fix the call to fcntl with F_FULLFSYNC on macOS when the MDB_WRITEMAP option is used, using the correct env->me_fd rather than env->me_mfd.