Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Dev

[mythtv-commits] Ticket #7949: Multiple identical partitions on identical drives are listed as only one Mythtv drive

 

 

MythTV dev RSS feed   Index | Next | Previous | View Threaded


f-myth-users at media

Feb 2, 2010, 11:58 PM

Post #1 of 3 (650 views)
Permalink
[mythtv-commits] Ticket #7949: Multiple identical partitions on identical drives are listed as only one Mythtv drive

> Date: Sat, 23 Jan 2010 17:35:42 -0000
> From: "MythTV" <mythtv [at] cvs>

> Changes (by cpinkham):

> Comment:

> This is a known issue that automatically corrects itself once you have the
> first recording on each drive. We have not come up with a determinate,
> easy, replicatable solution to determine whether
> filesystems are indeed the same filesystem, links to the same filesystem,
> bind mounts, nfs mounts, cifs mounts, etc. blah to the same filesystem.

I've never been clear about why this is true. Maybe this was
discussed in the past and I just missed it somehow.

Wouldn't it be possible to write a different nonce to every filesystem
and then see which nonces have appeared in multiple places? After
all, Myth -does- have permission to write (if it didn't, we wouldn't
care if they were the same because we're not trying to load-balance
to them), so why not gensym a name for each, touch it, check which
have appeared where, and then delete the nonces again? It seems like
this would be much simpler logic (and simpler to prove correct) than
the current heuristic.

What am I missing?
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


cpinkham at bc2va

Feb 3, 2010, 12:54 AM

Post #2 of 3 (612 views)
Permalink
Re: [mythtv-commits] Ticket #7949: Multiple identical partitions on identical drives are listed as only one Mythtv drive [In reply to]

* On Wed Feb 03, 2010 at 02:58:47AM -0500, f-myth-users [at] media wrote:
> > Changes (by cpinkham):
>
> > Comment:
>
> > This is a known issue that automatically corrects itself once you have the
> > first recording on each drive. We have not come up with a determinate,
> > easy, replicatable solution to determine whether
> > filesystems are indeed the same filesystem, links to the same filesystem,
> > bind mounts, nfs mounts, cifs mounts, etc. blah to the same filesystem.

Note I use the term filesystem, not directory above.

> I've never been clear about why this is true. Maybe this was
> discussed in the past and I just missed it somehow.

Yeah, it's been discussed, not quite as many times as what commercial
flagging enhancements could be made, but just about as many. :)

> Wouldn't it be possible to write a different nonce to every filesystem
> and then see which nonces have appeared in multiple places? After
> all, Myth -does- have permission to write (if it didn't, we wouldn't
> care if they were the same because we're not trying to load-balance
> to them), so why not gensym a name for each, touch it, check which
> have appeared where, and then delete the nonces again? It seems like
> this would be much simpler logic (and simpler to prove correct) than
> the current heuristic.

I've thought about this method before and to me it sounds a lot more
complicated than the current method.

Currently, we do something like this:

1) master backend asks each slave about their configured directories
2) master compares sizes to see if they match within a given threshold
3) master compares free space to see if it matches within a given threshold
4) if 2 & 3 are true for two entries, then these must be the same filesystem

With a temp file written to each Storage Group Directory, we're
talking more along the lines of this:

1) master backend tells slaves to write out a temp file to all their
Storage Group dirctories
2) each backend writes out a temp file to each directory it has configured
and that it can write to (remember, not all Storage Group directories are
for recordings and may not be writeable by the backend)
3) master asks backends which files they can see in their SG directories
that are less than X seconds old
4) master gets list of all files/hosts and runs a bunch of loops to see
who can see what.
4b) master tells slaves to delete all their temp files
5) master now has a list that says:
host1:/nas/video1 == host2:/nas/video1 and host3:/nas/video1
host2:/nas/video2 == host3:/nas/video4 and host4:/nas/video3
host1:/nas/video3 == host3:/nas/video6 and host4:/nas/video8
6) now the master has to determine what filesystem these directories are
on. remember, we want to schedule recordings across filesystems/spindles,
not across different directories which may be on the same filesystem.
7) master gives up and goes and executes the old code above which checks
filesystem sizes and free space and determines that the user inadvertently
create /nas on their host1 root filesystem and created subdirs of
/nas/video1 and /nas/video3 and these are actually the same filesystem.

It's not enough to know that two hosts can see the same directory,
we want to know if directories 1 and 2 are on the same filesystem.
If we restricted Storage Groups somehow so that you could not create
multiple SG directories (whether in the same group or not) on the same
filesystem, then it might be easier, but one of the biggest advantages
of Storage Groups and the disk scheduling is the fact that you can
spread out the I/O load and minimize seeking, fragmentation, etc..

We also need to handle the situation where all storage is remote.
These filesystems could all be on one or more NFS or CIFS servers on
the network, so we can't query the OS to ask if directory A and
directory B are on the same filesystem. We can't see the fsid of
the NFS share we've mounted twice on the same server or that
/nas/video1 and /nas/video2 are on the same /nas filesystem on
the fileserver.

Long-story-short, the current method is what will be used until
someone makes a good case for a new method. And 'good case' in
this context includes a working patch that provides a worthwhile
enhancement over the existing method. The current method is
implemented in about 25 lines of code.

--
Chris
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev


f-myth-users at media

Feb 3, 2010, 11:39 AM

Post #3 of 3 (588 views)
Permalink
[mythtv-commits] Ticket #7949: Multiple identical partitions on identical drives are listed as only one Mythtv drive [In reply to]

> Date: Wed, 03 Feb 2010 13:49:22 -0500
> From: Dan Wilga <mythtv-dev2 [at] dwilga-linux1>

> On 2/3/10 1:19 PM, Chris Pinkham wrote:
> > I've been considering the possibility of having the master resolve
> > the situation automatically without waiting for a recording by having
> > the affected backends write out a random-sized 0-10 megabyte file

> Why not just write a zero-length file with a unique name to each drive,
> and see if any file exists in more than one place? Surely a directory
> read or fopen would be faster than recalculating free space a second time.

That's the same thing -I- suggested 11-ish hours ago when I restarted
the thread, and Chris pointed out that it doesn't work: SG's might
be placed on disjoint directories that share a filesystem, so your
nonces will appear unique but in fact share a filesystem. [.Granted,
even sharing a -disk- is an issue for load-balancing, but I'm not
sure how Myth is ever supposed to figure -that- out in a robust
and portable way.] You should go back and check the whole thread.

The "random-length files" thing is the second thing I suggested,
which is also hardly an original idea (unsurprising); see Chris's
snippet above.

The third thing I suggested was the "punt it back to the user by
issuing a disclaimer if we see a situation that Myth is unlikely
to get right without a bunch more possibly-error-prone code",
which at least has the virtue of adding nothing but an "if" and
a string to the codebase.
_______________________________________________
mythtv-dev mailing list
mythtv-dev [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

MythTV dev RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.