From f2a37933b1ffa0d3b60df3a24ec201a3dba2a6cd Mon Sep 17 00:00:00 2001 From: NyaMisty Date: Mon, 3 Jun 2024 05:12:25 +0800 Subject: [PATCH] Fix sorted needle file's write mode for (*SortedFileNeedleMap).Delete() (#5633) --- weed/storage/needle_map_sorted_file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/storage/needle_map_sorted_file.go b/weed/storage/needle_map_sorted_file.go index 0433ffa0d..5bd67ea86 100644 --- a/weed/storage/needle_map_sorted_file.go +++ b/weed/storage/needle_map_sorted_file.go @@ -27,7 +27,7 @@ func NewSortedFileNeedleMap(indexBaseFileName string, indexFile *os.File) (m *So } glog.V(1).Infof("Opening %s...", fileName) - if m.dbFile, err = os.Open(indexBaseFileName + ".sdx"); err != nil { + if m.dbFile, err = os.OpenFile(indexBaseFileName+".sdx", os.O_RDWR, 0); err != nil { return } dbStat, _ := m.dbFile.Stat()