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

weed fix loses (some) indices? #87

Closed
devinrsmith opened this issue Feb 18, 2015 · 7 comments
Closed

weed fix loses (some) indices? #87

devinrsmith opened this issue Feb 18, 2015 · 7 comments

Comments

@devinrsmith
Copy link

I've got an .dat volume with .idx that I thought might be corrupt. So I backed it up and ran

weed fix ...

It produced an idx file that was smaller than the older one, but the weed volume seemed to come up fine. Unfortunately, it seemed like some things (I haven't confirmed if it's just some items or all) returned 404s, whereas the previous index worked. (Against the same .dat file).

@chrislusf
Copy link
Collaborator

Can you please attach the new and old idx files here?

@devinrsmith
Copy link
Author

I'll send you a message.

@chrislusf
Copy link
Collaborator

Thanks for the data. I think it's related to server not cleanly shutdown. So there are one wrongly formed file. The "weed fix" tool read all file one by one. So all following files are missing.

I remember you did some upgrade and it seems related to that. What version were you upgrading from? And how did you stop the weed volume server? Versions after May 13, 2014 will act on the system interruptions and do a clean shutdown.

I am planning to add a functionality to check the volume files upon starting.

@chrislusf
Copy link
Collaborator

Was there any replication for this volume 3?

@devinrsmith
Copy link
Author

Yes, I had 3 volume servers total, 1 backup per index.

chrislusf added a commit that referenced this issue Mar 9, 2015
For bug #87 and #93, add special handling to recover data if possible.
@chrislusf
Copy link
Collaborator

Add some fix for this case. The error handling for replicated writing has a bug, which corrupts the .dat file. The fix will remove the wrong way to handle error.

For existing data, I also added some special handing to avoid possible problem. But it seems still I am not able to recover all the data via "weed fix". For now, you would need to upgrade to the latest version and keep using existing .idx files to avoid losing any data.

@chrislusf
Copy link
Collaborator

Please try to use this file to fix the issue. https://github.com/chrislusf/weed-fs/blob/master/unmaintained/fix_dat/fix_dat.go

chrislusf pushed a commit that referenced this issue Nov 25, 2021
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