varun2784 / weed-fs

Automatically exported from code.google.com/p/weed-fs
0 stars 0 forks source link

Slice bounds out of range, when deleting all images in store 0.26 #13

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
It seems when you delete all of the images, you get a error, and I could not 
add any more images:

http: panic serving [::1]:60851: runtime error: slice bounds out of range 56/usr/local/go/src/pkg/net/http/server.go:589 (0x80b928a) 57/usr/local/go/src/pkg/runtime/proc.c:1443 (0x8060363) 58/usr/local/go/src/pkg/runtime/runtime.c:128 (0x8060e7b) 59/usr/local/go/src/pkg/runtime/runtime.c:91 (0x8060d59) 60/home/rootcoma/git-repos/weed-fs/weed-fs/src/pkg/storage/needle_read_write.go: 78 (0x80876fc) 61/home/rootcoma/git-repos/weed-fs/weed-fs/src/pkg/storage/volume.go:135 (0x808c643) 62/home/rootcoma/git-repos/weed-fs/weed-fs/src/pkg/storage/store.go:190 (0x808b677) 63/home/rootcoma/git-repos/weed-fs/weed-fs/src/cmd/weed/volume.go:120 (0x804dbe7) 64/home/rootcoma/git-repos/weed-fs/weed-fs/src/cmd/weed/volume.go:90 (0x804d5bb) 65/usr/local/go/src/pkg/net/http/server.go:703 (0x80ae0a5) 66/usr/local/go/src/pkg/net/http/server.go:941 (0x80aeca6) 67/usr/local/go/src/pkg/net/http/server.go:669 (0x80adef1) 68/usr/local/go/src/pkg/runtime/proc.c:271 (0x805e6e1)


Steps:
1. add 5 or 6 images
2. delete them all

Expected output would be to allow further storing of files at least, and not 
display error hopefully.

0.26, windows 64bit and linux 32bit

Original issue reported on code.google.com by micjohn...@gmail.com on 31 Dec 2012 at 3:17

GoogleCodeExporter commented 8 years ago
Also ran this with 1 volume server with max=5, so I would add at least one 
image to all 5 volumes, then empty them of images completely.

Original comment by micjohn...@gmail.com on 31 Dec 2012 at 3:23

GoogleCodeExporter commented 8 years ago
This is related to the automatic reclaiming free spaces. By default, weedfs 
created 5 volumes, and with maximum also set to 5. If every volume has only one 
deleted file, all of the volumes will be in read-only mode.

Before the fix, the workaround would be to increase the default max, from max=5 
to max=15, for example.

Original comment by chris...@gmail.com on 31 Dec 2012 at 6:46

GoogleCodeExporter commented 8 years ago
Fixed in the master branch.

Original comment by chris...@gmail.com on 2 Jan 2013 at 11:40