Fixed both instances in trunk... They were trivial changes (although I put the cache clear in a different place), but I might not have totally understood the original goals of the singleton caches. Feel free to berate my fail :)
Also haven't figured a decent test, since the issue tends to happen in parallel processes. Any ideas? -Dormando Frank Ng wrote: > We see the same thing in our test mogilefs env. i made a change of > mindevcount from 2 to 3 and ran mogadm class list a few times, it's show > alternating results. > > [EMAIL PROTECTED] mogdata]# mogadm class list > domain class mindevcount > -------------------- -------------------- ------------- > snf_test01 default 2 > snf_test01 snf_hr 2 > snf_test01 snf_lr 3 <-- > > [EMAIL PROTECTED] mogdata]# mogadm class list > domain class mindevcount > -------------------- -------------------- ------------- > snf_test01 default 2 > snf_test01 snf_hr 2 > snf_test01 snf_lr 2 <-- > > [EMAIL PROTECTED] mogdata]# mogadm domain list > domain class mindevcount > -------------------- -------------------- ------------- > snf_test01 default 2 > snf_test01 snf_hr 2 > snf_test01 snf_lr 2 <-- > > [EMAIL PROTECTED] mogdata]# mogadm domain list > domain class mindevcount > -------------------- -------------------- ------------- > snf_test01 default 2 > snf_test01 snf_hr 2 > snf_test01 snf_lr 3 <-- > > > On Wed, Mar 12, 2008 at 3:58 AM, Chaos Wang <[EMAIL PROTECTED] > <mailto:[EMAIL PROTECTED]>> wrote: > > Hi, > > I use the MogileFS code from official svn trunk to do some test. But > when I do some domain addition/deletion operations, the output of > 'mogadm domain list' becomes inconsistent between different calls. > This phenomenon can be repeated by following steps: > > 1. mogadm domain add xxx > 2. mogadm domain delete xxx > 3. mogadm domain add yyy > 4. mogadm domain list (several times) > > I thinks the problem is in the invalidate_cache() method in > MogileFS::Domain module, because it forget to clean up the hash map > %singleton (of_dmid(), which is called in domains(), used this hash > map before trying %id2name map). After made the following changes in > MogileFS::Domain::invalidate_cache(), the phenomenon doesn't show up > again: > > --code begin-- > sub invalidate_cache { > ... > %id2name=(); > %name2id=(); > %singleton=(); # XXX: this is newly added > ... > --code end-- > > And I have another question: does classes belong to certain domain? > If so, why delete a domain does not clean up the classes under it? > >
