seaweedfs/weed/storage
Konstantin Lebedev e20f0dbd2d
avoid data race of TraverseBfs (#3856)
* avoid data race of TraverseBfs

* close is enough
avoid panic
I1014 12:29:59.207120 volume_loading.go:131 loading sorted db /tmp/sw/test2_19.sdx error: unexpected file /tmp/sw/test2_19.idx size: 255
I1014 12:29:59.207125 volume_loading.go:119 open to write file /tmp/sw/test4_26.idx
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x5260a4c]

goroutine 287 [running]:
github.com/seaweedfs/seaweedfs/weed/storage.(*SortedFileNeedleMap).Close(0x0)
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/needle_map_sorted_file.go:97 +0x2c
github.com/seaweedfs/seaweedfs/weed/storage.(*Volume).load.func1()
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/volume_loading.go:32 +0x8e
github.com/seaweedfs/seaweedfs/weed/storage.(*Volume).load(0xc001b36280, 0x1, 0x1, 0x0, 0x69228c0?)
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/volume_loading.go:205 +0x256c
github.com/seaweedfs/seaweedfs/weed/storage.NewVolume({0x7ffeefbff6e0, 0x7}, {0x7ffeefbff6e0, 0x7}, {0xc0009a9284, 0x5}, 0x13, 0x0, 0x0, 0x0, ...)
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/volume.go:62 +0x30f
github.com/seaweedfs/seaweedfs/weed/storage.(*DiskLocation).loadExistingVolume(0xc0006f40c0, {0x846c8d0, 0xc0009ce600}, 0x0?, 0x1)
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/disk_location.go:161 +0x4da
github.com/seaweedfs/seaweedfs/weed/storage.(*DiskLocation).concurrentLoadingVolumes.func2()
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/disk_location.go:201 +0xf9
created by github.com/seaweedfs/seaweedfs/weed/storage.(*DiskLocation).concurrentLoadingVolumes
        /Users/tochka/GolandProjects/seaweedfs/weed/storage/disk_location.go:198 +0x150
2022-10-16 11:30:41 -07:00
..
backend vacuum metrics and force sync dst files (#3832) 2022-10-13 00:51:20 -07:00
erasure_coding vacuum metrics and force sync dst files (#3832) 2022-10-13 00:51:20 -07:00
idx ADHOC: Volume fsck use a time cutoff param (#3626) 2022-09-10 15:29:17 -07:00
needle refactor(storage): readability improvements (#3703) 2022-09-16 02:43:17 -07:00
needle_map vacuum metrics and force sync dst files (#3832) 2022-10-13 00:51:20 -07:00
super_block move proto package 2022-08-17 12:05:07 -07:00
types move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_info avoid load volume file with BytesOffset mismatch (#3841) 2022-10-14 00:18:09 -07:00
disk_location.go vacuum metrics and force sync dst files (#3832) 2022-10-13 00:51:20 -07:00
disk_location_ec.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
idx_binary_search_test.go ADHOC: Volume fsck use a time cutoff param (#3626) 2022-09-10 15:29:17 -07:00
needle_map.go Optimiz leveldb metric (#3830) 2022-10-11 21:13:25 -07:00
needle_map_leveldb.go types packages is imported more than onece (#3838) 2022-10-12 22:59:07 -07:00
needle_map_memory.go Optimiz leveldb metric (#3830) 2022-10-11 21:13:25 -07:00
needle_map_metric.go optimiz commitig compact (#3388) 2022-08-23 23:53:35 -07:00
needle_map_metric_test.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
needle_map_sorted_file.go avoid data race of TraverseBfs (#3856) 2022-10-16 11:30:41 -07:00
store.go avoid load volume file with BytesOffset mismatch (#3841) 2022-10-14 00:18:09 -07:00
store_ec.go refactor(storage): readability improvements (#3703) 2022-09-16 02:43:17 -07:00
store_ec_delete.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
store_vacuum.go refactor(storage): readability improvements (#3703) 2022-09-16 02:43:17 -07:00
volume.go vacuum metrics and force sync dst files (#3832) 2022-10-13 00:51:20 -07:00
volume_backup.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_backup_test.go refactoring 2019-04-17 22:04:49 -07:00
volume_checking.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_info.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_info_test.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_loading.go avoid load volume file with BytesOffset mismatch (#3841) 2022-10-14 00:18:09 -07:00
volume_read.go ADHOC: filter deleted files from idx file binary search (#3763) 2022-09-29 12:48:36 -07:00
volume_read_all.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_read_test.go ADHOC: add read needle meta grpc (#3581) 2022-09-06 23:51:27 -07:00
volume_super_block.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00
volume_tier.go avoid load volume file with BytesOffset mismatch (#3841) 2022-10-14 00:18:09 -07:00
volume_vacuum.go vacuum metrics and force sync dst files (#3832) 2022-10-13 00:51:20 -07:00
volume_vacuum_test.go optimiz commitig compact (#3388) 2022-08-23 23:53:35 -07:00
volume_write.go ensure monotonic n.AppendAtNs 2022-10-13 23:15:00 -07:00
volume_write_test.go move to https://github.com/seaweedfs/seaweedfs 2022-07-29 00:17:28 -07:00