Commit 9732faa
fix(memory): memoryFlush fires every compaction cycle instead of every other
After a memoryFlush during compaction, memoryFlushCompactionCount was
reassigned to the post-increment compactionCount, locking both counters
to the same value. The dedup gate hasAlreadyFlushedForCurrentCompaction
then saw equal values and skipped the next flush.
Fix: stop reassigning memoryFlushCompactionCount to the post-increment
value. The counter stays at N (pre-increment); after incrementCompactionCount,
compactionCount becomes N+1. Next cycle, N !== N+1, flush fires.
Closes #12590.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent d3eeadb commit 9732faa
2 files changed
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
791 | 791 | | |
792 | 792 | | |
793 | 793 | | |
794 | | - | |
| 794 | + | |
795 | 795 | | |
796 | 796 | | |
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
800 | | - | |
| 800 | + | |
801 | 801 | | |
802 | 802 | | |
803 | 803 | | |
| |||
823 | 823 | | |
824 | 824 | | |
825 | 825 | | |
826 | | - | |
827 | | - | |
828 | | - | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
829 | 830 | | |
830 | 831 | | |
831 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
292 | 292 | | |
293 | 293 | | |
294 | 294 | | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
295 | 326 | | |
296 | 327 | | |
297 | 328 | | |
| |||
0 commit comments