Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

2.2.1: SAVE fails - main index checkpoint buffer only 512-byte aligned on 4096-sector device (NativeStorageDevice misaligned I/O)

Open
#2,239 2 comments 0 reactions 1 assignee View on GitHub

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
  1. Start Garnet 2.2.1 with its data directory on a 4096-byte-sector filesystem.
  2. Write some keys.
  3. 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/garnet

All issues in microsoft/garnet

Similar issues

More C# issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.