apache / apache/maka

feat(storage): implement Windows directory synchronization (FlushFileBuffers)

Open
#3,898 2 comments 0 reactions 1 assignee Claimed by @scs0209 View on GitHub
enhancement good first issue help wanted
Dominant language
TypeScript
Stars
5.4k
Forks
502
Avg merge
1d 2h
Merged PRs (30d)
715

Description

## Summary

On Windows, \syncDirectory()\ is a no-op, meaning directory-level durability guarantees are weaker than on POSIX. Newly created/renamed/linked/removed entries may not survive power loss.

## Current State

- **\docs/windows-support.md:193-199\**: Documents the gap
- **No implementation** exists for Windows directory synchronization

## Proposed Solution

1. Implement Windows directory synchronization using \FlushFileBuffers\ on directory handles
2. Use \CreateFile\ with \FILE_FLAG_WRITE_THROUGH\ for directory handles
3. Call \FlushFileBuffers\ after directory operations
4. Document the durability boundary for Windows

## Acceptance Criteria

- [ ] \syncDirectory()\ works on Windows
- [ ] Directory operations are durable across power loss
- [ ] Performance impact is acceptable
- [ ] Documentation updated

## Labels

enhancement, help wanted

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.