glyustb / mogilefs

Automatically exported from code.google.com/p/mogilefs
0 stars 0 forks source link

Delete Worker thread crashes #41

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. start mogilefsd with debugging enabled
2.
3.

What is the expected output? What do you see instead?
files get deleted off of devices storing the files when they are deleted from 
MogileFS

instead the following error occurs:
[Tue Sep 27 14:55:33 2011] crash log: Can't locate object method "exists" via 
package "MogileFS::Device" at /usr/local/share/perl5/MogileFS/Worker/Delete.pm 
line 312.
[Tue Sep 27 14:55:34 2011] Child 19202 (delete) died: 256 (UNEXPECTED)

What version of the product are you using? On what operating system?
git version: 2.53-4-g1c3d73f

Original issue reported on code.google.com by daniel.frett on 27 Sep 2011 at 6:56

GoogleCodeExporter commented 8 years ago
I have a note to fix this already, however:

That broken code is in the *old* section of the delete worker. Any modern 
MogileFS install shouldn't be touching this code at all.

You should look for rows in file_to_delete or file_to_delete_later and ensure 
new rows aren't entering there, and if there are rows, either delete them or 
port them over to file_to_delete2.

Should probably add randomized warnings generated by that old delete code now, 
as a few people have still been using it somehow.

Original comment by dorma...@rydia.net on 27 Sep 2011 at 7:04

GoogleCodeExporter commented 8 years ago
I am using the FilePaths plugin, that may be what is queueing up files in that 
table

Original comment by daniel.frett on 27 Sep 2011 at 7:05

GoogleCodeExporter commented 8 years ago
just checked the code, it looks like the FilePaths plugin is directly 
interacting with the tables

http://cpansearch.perl.org/src/HACHI/MogileFS-Plugin-FilePaths-0.02/lib/MogileFS
/Plugin/FilePaths.pm
around line 40-50:
            $dbh->do("DELETE FROM file WHERE fid=?", undef, $oldfid);
            $dbh->do("REPLACE INTO file_to_delete SET fid=?", undef, $oldfid);

Original comment by daniel.frett on 27 Sep 2011 at 7:08

GoogleCodeExporter commented 8 years ago
Neat. I'll leave this issue open until we can push a new FilePaths, but that is 
pretty dead code.

You should be able to quickly patch it yourself by using the same code that 
Query.pm uses to delete a file. $fid->delete or something :P

Original comment by dorma...@rydia.net on 27 Sep 2011 at 7:10

GoogleCodeExporter commented 8 years ago
I'll try and get some time at work to update the FilePaths plugin since we are 
using it with a MogileFS FUSE mount for handling uploaded files to a 
load-balanced wordpress install.

I'll fork my work off of https://github.com/hachi/MogileFS-Plugin-FilePaths 
unless you have a better place to point me :)

Original comment by daniel.frett on 27 Sep 2011 at 7:21

GoogleCodeExporter commented 8 years ago
I just made a github pull request that updates FilePaths to utilize the 
MogileFS::FID and MogileFS::Store framework for database interaction

https://github.com/hachi/MogileFS-Plugin-FilePaths/pull/2

Original comment by daniel.frett on 29 Sep 2011 at 5:35

GoogleCodeExporter commented 8 years ago
Tahnks! I've pulled your change into master (sorry for the long delay on that)

I'll ping hachi to check his pull requests for FilePaths.

Original comment by dorma...@rydia.net on 29 Oct 2011 at 12:13