2.2.1: SAVE fails - main index checkpoint buffer only 512-byte aligned on 4096-sector device (NativeStorageDevice misaligned I/O)
Maintainers usually reply within 2 days
@TedHartMS is already working on this.
Since Oct 13, 2026.
Assessment
This issue has not been assessed yet.
Description
Summary
On Garnet 2.2.1, SAVE fails because the main index checkpoint write is rejected as misaligned. The file offset and length are both 4096-aligned. The in-memory staging buffer is not: it sits on a 512-byte boundary while the device sector size is 4096.
Environment
- Image
ghcr.io/microsoft/garnet:2.2.1, Linux, default device type (native O_DIRECT path). - Data directory on a ZFS dataset that reports a 4096-byte sector size.
Steps
- Start Garnet 2.2.1 with its data directory on a 4096-byte-sector filesystem.
- Write some keys.
- Run
SAVE.
Actual result
The client receives ERR checkpoint failed, check server logs. The server log contains:
TsavoriteKV BeginMainIndexCheckpoint failed … NativeStorageDevice.WriteAsync: misaligned I/O — sector size is 4096, but offset=0x0, length=134217728, buffer=0x00007F2D74000200. All three values must be a multiple of the device sector size for the O_DIRECT / libaio / io_uring path.
0x...0200 is 512-aligned but not 4096-aligned. The offset (0x0) and length (128 MiB) are both aligned, so the failure is the index checkpoint buffer's alignment.
Expected result
When the device reports a 4096-byte sector, the checkpoint buffer should be allocated with the device's sector alignment, and SAVE should succeed.
Workaround
We are switching to --device-type FileStream, which does not use O_DIRECT. We will confirm in a comment whether that works.
Related
This looks like the same native checkpoint I/O path as #2134 and #2228
- Dominant language
- C#
- Stars
- 12k
- Forks
- 711
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 56
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/garnet
-
HINCRBY wraps on int64 overflow and stores the resultPossibly taken @TedHartMS claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
microsoft/garnet#2243 · 1 assignee ·
Maintainers usually reply within 2 days
-
An integer argument >= 2^64 returns "ERR Protocol Error" and closes the connection (INCRBY, PEXPIRE, LRANGE, LINDEX, …)Possibly taken @TedHartMS claimed this today. Open
microsoft/garnet#2249 · 1 assignee ·
Maintainers usually reply within 2 days
-
INCR rejects a stored INT64_MIN valuePossibly taken @TedHartMS claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
microsoft/garnet#2246 · 1 assignee ·
Maintainers usually reply within 2 days
-
Large PEXPIRE closes the connection without a replyPossibly taken @TedHartMS claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
microsoft/garnet#2245 · 1 assignee ·
Maintainers usually reply within 2 days
-
Expired keys still affect type checks, SETNX and DELPossibly taken @TedHartMS claimed this today. Open
Difficulty 3/5 1-2 days Newbie friendliness 62/100
microsoft/garnet#2244 · 1 assignee ·
Maintainers usually reply within 2 days
All issues in microsoft/garnet
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
Maintainers usually reply within 1 day
-
good first issue help wanted ready-for-human
Difficulty 2/5 Half a day Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
ready-for-agent size:S status:todo
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
elsa-workflows/elsa-foundation#2830 ·
Maintainers usually reply within 1 day
-
Review - Maintainer WG-Maintainers-Build
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
PowerShell/PowerShell#28220 · 1 comment ·
Maintainers usually reply within 1 day
-
area: docs eco: dotnet good first issue help wanted lane: free-agent roadmap size: XS type: docs
Difficulty 2/5 Under an hour Newbie friendliness 72/100
arminazimi/evergreen#377 ·
Maintainers usually reply within 1 day