mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-13 15:29:12 +01:00
mount: test the periodic flush after a peer unlinks a hard link name
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1787a31209
commit
c2aef0cf53
1 file changed
+19
@@ -132,3 +132,22 @@ func TestPeerUnlinkLastNameKeepsHandleDeleted(t *testing.T) {
|
||||
t.Fatal("a peer unlinking the only name did not mark the handle deleted")
|
||||
}
|
||||
}
|
||||
|
||||
// The periodic metadata flush publishes through the survivor as well.
|
||||
func TestPeerUnlinkedAliasKeepsPeriodicFlushPublishing(t *testing.T) {
|
||||
wfs, fake, fh, inode := openLinkTestFile(t)
|
||||
linkInRoot(t, wfs, inode, "final")
|
||||
peerUnlink(t, wfs, fake, "tmp")
|
||||
fh.UpdateEntry(func(e *filer_pb.Entry) {
|
||||
e.Chunks = append(e.Chunks, linkHandleChunk(2, 100))
|
||||
e.Attributes.FileSize = 200
|
||||
})
|
||||
fh.dirtyMetadata = true
|
||||
if err := wfs.flushFileMetadata(fh); err != nil {
|
||||
t.Fatalf("periodic flush after the peer unlink: %v", err)
|
||||
}
|
||||
wantStored(t, fake, "final", 2, 1)
|
||||
if fake.stored("tmp") != nil {
|
||||
t.Fatal("the periodic flush recreated tmp")
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user