Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting a collection prevents future insertions into collection of the same name #476

Closed
4scastro opened this issue Mar 24, 2017 · 4 comments

Comments

@4scastro
Copy link

I've noticed that if I write some image data to a collection, delete that collection, and then attempt to write image data again to a collection of the same name the second insertion fails. This is probably better explained by the commands that I'm running and the output that I'm receiving.

So starting with a clean slate I first insert some image data into a collection:

curl -X POST http://localhost:9333/dir/assign?collection=data
{"fid":"6,01b7f306cd","url":"localhost:8080","publicUrl":"localhost:8080","count":1}
curl -X PUT -F file=@test.jpg http://127.0.0.1:8080/6,01b7f306cd
{"name":"test.jpg","size":758811}

So far so good. I am also able to successfully delete the collection:

curl -X POST http://localhost:8080/admin/delete_collection?collection=data
{"error":""}

Then I repeat the attempt to insert the same image data into a collection of the same name:

curl -X POST http://localhost:9333/dir/assign?collection=data
{"fid":"1,024fc8edca","url":"localhost:8080","publicUrl":"localhost:8080","count":1}
curl -X PUT -F file=@test.jpg http://127.0.0.1:8080/1,024fc8edca

However this time I get an error message as a response:

{"name":"test.jpg","error":"Failed to write to local disk (Volume 1 not found!)"}

My first instinct was that I had done something catastrophically wrong; however, I am able to write data to collections of different names as usual, so it would seem it is just writing data to a previously deleted collection which is the problem. To me this indicates a bug, then again I have only been using seaweed for a day, so it may be that I'm misunderstanding the intention of collections (please tell me if this is the case!).

Cheers,
Simon

@chrislusf
Copy link
Collaborator

You are deleting from the volume server. Try to delete from the master server.

@4scastro
Copy link
Author

Hi Chris,

Thanks for the quick reply. If I delete from the master server then I get a "404 page not found message". The command I ran was:

curl -X POST http://localhost:9333/admin/delete_collection?collection=data

@chrislusf
Copy link
Collaborator

curl http://localhost:9333/col/delete?collection=data

But I think you showed a bug here after SeaweedFS switched to gRPC. The deleted volumes are not reported back to the master server now. Need to fix it in a proper way.

@chrislusf chrislusf reopened this Mar 27, 2017
@4scastro
Copy link
Author

Late reply here, but that command works perfectly. thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants