From: Allen, B. S <bs...@la...> - 2012-05-18 17:03:42
|
It doesn't look like you protect against the chunk being updated via MFS (or anything else) between the time you do shutil.copy2 to the time you do the symlink. I see that you check mtime on the chunk, and check that its been at least 60 seconds since the last modification. In my opinion this rebalance technique is dangerous without someway guaranteeing the chunk can't be updated. Hacky way of ensuring there's no changes to the chunk until after it is copied: 1. Change the permissions of the live chunk to not be writable by MFS. Copy, move original, symlink back, fix permissions of the copy, remove original. 2. Maybe use chflags or similar to make the chunk file immutable during the copy. I have no idea what MFS will do if it tries to write to a non-writtable chunk file. Also instead of symlinks you could use bind mounting, which would eliminate the need for the patch. Although this would make a ton of mounts. Ideally this functionality should be built into mfschunkserver, since it obviously can stop itself from writing to a chunk thats being rebalanced. Ben On May 18, 2012, at 10:23 AM, Davies Liu wrote: On Fri, May 18, 2012 at 10:35 PM, Boris Epstein <bor...@gm...<mailto:bor...@gm...>> wrote: On Fri, May 18, 2012 at 10:31 AM, Davies Liu <dav...@gm...<mailto:dav...@gm...>> wrote: On Fri, May 18, 2012 at 9:36 PM, Boris Epstein <bor...@gm...<mailto:bor...@gm...>> wrote: Davies, How would you do that? Do you just copy the whole chunk storage directory? Yes,it do not matter which disk the chunk data was stored. If one disk has less free space, we could even move part of them to another. After a patch for chunk server, make a symlink for moved chunks, we could do this disk usage adjustment online, without shutting down chunk server. mfsrebalance.py, as attached, can do this automatically. But I think the task is to take the entire chunk server off line - then do you just move the content? Then how does the system know where to look for it? No,you do not need to shut down chunk server, after moving a chunk file, mfsrebalance.py will create a symlink for original path. If you just copy chunk data, you do not need shut down chunk server too. After restarting, the chunk server will now the new path for moved chunks. Boris. ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ moosefs-users mailing list moo...@li...<mailto:moo...@li...> https://lists.sourceforge.net/lists/listinfo/moosefs-users -- - Davies ------------------------------------------------------------------------------ Live Security Virtual Conference Exclusive live event will cover all the ways today's security and threat landscape has changed and how IT managers can respond. Discussions will include endpoint security, mobile security and the latest in malware threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ _______________________________________________ moosefs-users mailing list moo...@li...<mailto:moo...@li...> https://lists.sourceforge.net/lists/listinfo/moosefs-users |