File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -311,15 +311,20 @@ func loadMergeFiles(dirPath string) error {
311311 // should be moved to the original data directory, and the original data files should be deleted.
312312 for fileId := uint32 (1 ); fileId <= mergeFinSegmentId ; fileId ++ {
313313 destFile := wal .SegmentFileName (dirPath , dataFileNameSuffix , fileId )
314+ // will have bug here if continue, check it later.todo
315+
314316 // If we call Merge multiple times, some segment files will be deleted earlier, so just skip them.
315- if _ , err = os .Stat (destFile ); os .IsNotExist (err ) {
316- continue
317- } else if err != nil {
318- return err
319- }
317+ // if _, err = os.Stat(destFile); os.IsNotExist(err) {
318+ // continue
319+ // } else if err != nil {
320+ // return err
321+ // }
322+
320323 // remove the original data file
321- if err = os .Remove (destFile ); err != nil {
322- return err
324+ if _ , err = os .Stat (destFile ); err == nil {
325+ if err = os .Remove (destFile ); err != nil {
326+ return err
327+ }
323328 }
324329 // move the merge data file to the original data directory
325330 copyFile (dataFileNameSuffix , fileId , false )
You can’t perform that action at this time.
0 commit comments