Skip to content

Reduce time of write-schema by at least 5%, work around intermittent test on MacOS#220

Merged
mzabani merged 37 commits intomasterfrom
fsync-after-folder-creation
Sep 1, 2025
Merged

Reduce time of write-schema by at least 5%, work around intermittent test on MacOS#220
mzabani merged 37 commits intomasterfrom
fsync-after-folder-creation

Conversation

@mzabani
Copy link
Owner

@mzabani mzabani commented Aug 16, 2025

run test-with-db -- --match "persistRepsToDisk is inverse of readRepsFromDisk" failed intermittently on MacOS.
I initially thought this could be that posix doesn't guarantee write-then-read consistency ("thanks" ChatGPT for leading me down that rabbit hole), but then this PR showed it was always the same seeds that failed.
After removing non-ASCII characters from the Arbitrary ObjName instances, these tests stopped failing, so it's a character encoding issue, actually.
After trial and error, it became apparent that the ñ character from that Arbitrary instance is the only problematic character for MacOS (either that or test failures are significantly rarer without that). So it's no longer generated in our tests for MacOS. This is a workaround because I could not fix the issue for good.
I'm leaving comments in the code to articles that relate to the issue.

Other than that, some perf improvements after changing the code: write-schema && verify-schema went from 34.54 to 32.56 -> at least 5,7% time reduction in write-schema

@mzabani mzabani marked this pull request as draft August 16, 2025 17:41
@mzabani mzabani changed the title fsync to fix intermittent failure in MacOS fsync to fix intermittent test failure in MacOS Aug 17, 2025
@mzabani mzabani force-pushed the fsync-after-folder-creation branch from 1f760e9 to 5b6dbd7 Compare August 17, 2025 21:59
@mzabani mzabani changed the title fsync to fix intermittent test failure in MacOS ~fsync to~ fix intermittent test failure in MacOS Aug 22, 2025
@mzabani mzabani changed the title ~fsync to~ fix intermittent test failure in MacOS Try to fix intermittent test failure in MacOS Aug 25, 2025
@mzabani mzabani force-pushed the fsync-after-folder-creation branch from 159408b to 2926c51 Compare August 25, 2025 17:53
@mzabani mzabani force-pushed the fsync-after-folder-creation branch from 2926c51 to 0efdf4e Compare August 25, 2025 18:13
@mzabani mzabani force-pushed the fsync-after-folder-creation branch 2 times, most recently from 57bd9b9 to ab47600 Compare August 30, 2025 20:02
@mzabani mzabani changed the title Try to fix intermittent test failure in MacOS Reduce time of write-schema by at least 5%, work around intermittent test on MacOS Aug 30, 2025
@mzabani mzabani marked this pull request as ready for review September 1, 2025 19:39
@mzabani mzabani merged commit 6495f26 into master Sep 1, 2025
2 checks passed
@mzabani mzabani deleted the fsync-after-folder-creation branch September 1, 2025 19:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant