Return-Path: william@bourbon.usc.edu Delivery-Date: Fri Nov 7 07:35:48 2008 X-Spam-Checker-Version: SpamAssassin 3.2.3 (2007-08-08) on merlot.usc.edu X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.2.3 Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75]) by merlot.usc.edu (8.14.1/8.14.1) with ESMTP id mA7FZmwP020559 for ; Fri, 7 Nov 2008 07:35:48 -0800 Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1]) by bourbon.usc.edu (8.14.2/8.14.1) with ESMTP id mA7FTtPh026946 for ; Fri, 7 Nov 2008 07:29:55 -0800 Message-Id: <200811071529.mA7FTtPh026946@bourbon.usc.edu> To: cs551@merlot.usc.edu Subject: Re: Doubt in Final project 2 Date: Fri, 07 Nov 2008 07:29:55 -0800 From: Bill Cheng Someone wrote: > I have a doubt with respect to the index files in final project- 2 > > "All 3 index structures must have a disk image so that after a node > restarts (after a crash or a shutdown), it can reconstruct the > in-memory index structures in a timely fashion. T'herefore, you must > provide 3 different index files in the home directory of each node." > > What exactly is the meaning of re-contruct here ? Do we need to build > the contents of these files again. Or do we just start of from the > info already existing in it - assuming its true? The spec says "reconstruct the in-memory index structures". It means that just before the node shuts down, a in-memory index structure is in a certain state. After the node restarts, the same in-memory index structure should be reconstructed in such a way that the previous state was restored. This should be done by just reading the corresponding index file (i.e., the index file should contain enough information so that this reconstruction is possible). > Also, when a node shuts down and then restarts - and it finds some of > the data files are missing ( can this scenario be possible ?) If you don't touch what's inside HomeDir, then this should not happen if your code has no bugs. Of course, if nunki lost power and your node does not have a chance to write out the contents of your in-memory index structures, then it's possible to have inconsistencies. But for this project, you don't have to worry about that. > then all > the references to this file in the index file need to be deleted - So > a check at start-up should be done to validate the index file > contents right ? You mean you are going to scan the whole mini-filesystem? Well, that's not required. For most real systems, the OS will do a fairly complete filesystem check if the machine did not shutdown properly. So, if you have extra time and want to implement a similar check for your mini-filesystem, you can certainly do it (but you won't get credit for it as far as grading goes). -- Bill Cheng // bill.cheng@usc.edu