mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
test(storage): expose syscall probe and record sync contract
This commit is contained in:
1 parent
2042e3422b
commit
781e842ef1
2 files changed
+33
No files matched your search
@@ -151,3 +151,30 @@ func TestFdatasyncAcknowledgedWritesSurviveSIGKILL(t *testing.T) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Run under strace with the experiment environment unset/set to verify the
|
||||
// syscall boundary independently of the selected function's Go identity.
|
||||
func TestDataSyncSyscallProbe(t *testing.T) {
|
||||
s, e := CreateWALStore(filepath.Join(t.TempDir(), "volume"), 32, 4096)
|
||||
if e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
defer s.Close()
|
||||
s.DisableAutoFlushForRecoveryTest()
|
||||
if _, e = s.Recover(); e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
if _, e = s.Write(7, bytes.Repeat([]byte{0x6d}, 4096)); e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
if _, e = s.Sync(); e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
if e = s.flusher.flushOnce(); e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
b, e := s.Read(7)
|
||||
if e != nil || !bytes.Equal(b, bytes.Repeat([]byte{0x6d}, 4096)) {
|
||||
t.Fatalf("readback: %v", e)
|
||||
}
|
||||
}
|
||||
@@ -527,6 +527,12 @@ Notes:
|
||||
|---|---|---|---|---|---|---|
|
||||
| `INV-NVME-H2C-RANGE-001` | An H2CData range exceeding the expected transfer size is refused before slicing, including a uint32 offset-plus-length overflow; an exact-bound payload is preserved. | Frontend H2C receive validation; no storage state transition | `core/frontend/nvme/session.go` `recvH2CData` | `TestRecvH2CDataRangeBounds` (`core/frontend/nvme/h2c_bounds_test.go`) | — | ACTIVE |
|
||||
|
||||
### Experimental data-file synchronization
|
||||
|
||||
| ID | Invariant | Machine / transition | Enforced in | Tests | TLA+ | Status |
|
||||
|---|---|---|---|---|---|---|
|
||||
| `INV-WAL-DATA-SYNC-001` | Default WAL/extent sync remains fsync. Linux `SWBLOCK_SYNC=fdatasync` selects data-only sync for WAL/extent data; descriptor/map/create/directory durability still uses fsync. `SWBLOCK_PREZERO=1` writes every byte only at create, fsyncs, then refuses holes/unwritten FIEMAP mappings. Existing files are never prezeroed. | M1 Create / Sync / Checkpoint | `data_sync.go`, `data_sync_linux.go`; `walstore_v3.go` Create; `walstore.go` data sync seams | `TestPrezeroCreatesInitializedVolume`, `TestInitializedFileRejectsSparseAndUnwritten`, `TestFdatasyncAcknowledgedWritesSurviveSIGKILL`, `TestDataSyncSyscallProbe` (`core/storage/data_sync_linux_test.go`) | Same abstract durable sync action; syscall/extent initialization and process-crash versus power-loss limits are outside the model | ACTIVE |
|
||||
|
||||
## Part C. Change rules
|
||||
|
||||
How a fix or a feature is calibrated against this model:
|
||||
|
||||
Reference in new issue
Block a user