On Thursday, January 5, 2017 at 12:49:04 PM UTC-5, BillPedersen wrote:
> On Thursday, January 5, 2017 at 11:21:21 AM UTC-5,
johnwa...@yahoo.co.uk wrote:
> > On Thursday, 5 January 2017 15:23:03 UTC, David Froble wrote:
> > > Stephen Hoffman wrote:
> > > > On 2017-01-05 06:29:20 +0000, David Froble said:
> > > >
> > > >> I'm looking at a half dozen books on Amazon, all VMS internals and
> > > >> such publications. What I'm looking for is information on the DLM,
> > > >> data structures and design.
> > > >>
> > > >> There is a V5.2 from 1987. Not sure if this is what I'm looking for.
> > > >> Can anyone with the books check in theirs and tell me which has DLM
> > > >> information.
> > > >
> > > > Not exactly sure what sort of information you're looking for, here.
> > > > Use of the DLM on OpenVMS? Interested in the DLM design? Implementing
> > > > a DLM? Alternatives to the DLM? Etc...
> > >
> > > Briefly, I'm looking at the issue of byte range locking. My intentions, if I'm
> > > able to do so, are to come up with a preliminary design for additions to the VMS
> > > DLM to implement byte range locking, then distribute it to those interested to
> > > comment upon, add comments and suggestions, and present the result to VSI as a
> > > potential modification. It would be up to VSI as to whether to include it in VMS.
> > >
> > > I just don't have enough information now, and, will need some help, as right
> > > now, I'd come up with a solution looking for a problem. For instance, Postgre
> > > database, how large a range is reasonable, and if talking bytes, how many should
> > > be supported, which would determine the size of integer required. I figure a
> > > database could be rather large.
> > >
> > > Don't know that I need exact information on the data structures. Whoever
> > > implements such a modification would have to work from what's current in VMS.
> > > But I need enough information to get close to what might be required.
> > >
> > > One thing seems to be clear to me, it's not just the DLM, but I/O stuff would
> > > have to also be implemented to use the new feature. There it gets interesting.
> > > If using I/O buffers, how to determine the size for one thing. Or perhaps
> > > direct I/O into the "on disk" file?
> > >
> > > > Beyond the two manuals in the doc set and articles in the DEC and VMS
> > > > Technical Journals, Roy Davis' VAXcluster Principles book, most likely.
> > > > ISBN was 55558-112-9
> > > >
> > > > Less so the IDSM. The DLM gets a fairly general discussion in the IDSM,
> > > > but not much in the way of details.
> > > >
> > > > Or the OpenVMS source listings, for the full details.
> > > >
> > > > Or for more general interest, skim through the OpenSSL open-source
> > > > variant of clustering software that Compaq released; that was a Unix DLM
> > > > similar to the OpenVMS DLM. Or skim the books and resources about one
> > > > of the more recent variants; see
> > > >
https://en.wikipedia.org/wiki/Distributed_lock_manager for some pointers
> > > > to those.
> > > >
> > > > If you do want to go for an IDSM for this or other reasons, you'll be
> > > > looking at a mix of V6 and the V7 updates to get all of the information
> > > > with the "latest" available information. The V6 stuff was the last
> > > > full copy of the IDSM, the V7 subset documents added chapters with some
> > > > details on specific and then-newer areas.
> > > >
> > > > Closely related to the DLM is the distributed transaction manager;
> > > > DECdtm, and also the DEC RTR and the more recent open-source
> > > > 0MQ/ActiveMQ/RabbitMQ messaging packages.
> > > >
> > > >
> >
> > There is/was a Digital Technical Journal article on
> > the original architecture and design of the DLM.
> > It might be a bit, er, basic for your stated needs,
> > but you are in a better position than I am to make
> > that judgement.
> >
> > It's in the VAXcluster Systems special edition of the
> > DTJ, from September 1987, pages 29-44.
> >
> > I found it at
> >
http://www.dtjcd.vmsresource.org.uk/pdfs/dtj_v01-05_sep1987.pdf
> > but other sources may also be available e.g. Bitsavers.
> >
> > Are you aware that PATHWORKS did byte range locking
> > some twenty-odd years ago? Again, there is a DTJ special
> > issue with some potentially relevant info: Volume 4
> > Number 1, from 1992. The details have doubtless changed,
> > but the basics may or may not have changed.
> >
> > Here are a few words from the piece on Byte Range Locking:
> > "Byte Range Locking
> > The MS-NET architecture allows for concurrent
> > access to server-based files by multiple clients. PC
> > applications acquire this functionality through the
> > MS-DOS byte range locking calls. These calls allow
> > PC applications to lock and unlock ranges of bytes
> > in a file and to detect conflicts. Conflicts occur
> > when part or all of a range specified to be locked
> > has been locked from a previous call. In contrast,
> > the approach taken by RMS provides locking on a
> > record basis. RMS uses the VMS distributed lock
> > manager to implement this functionality. Unfortu-
> > nately, the lock manager is not well suited to imple-
> > menting byte range locks because the byte range is
> > represented in a form that allows the lock manager
> > to arbitrate access. Therefore, the file server imple-
> > ments its own lock database and arbitrates access
> > to shared files. Internally, the server process main-
> > tains a list of locks for each file the server has open
> > and arbitrates access based on these lock struc-
> > tures. Files opened by the file server cannot be
> > shared with other VMS processes because the file
> > server has an exclusive mode lock on each file it has
> > open through the VMS lock manager. The exclusive
> > mode lock guarantees protection from other VMS
> > processes.
> > [etc]"
> >
> >
> > The DLM article abstract says:
> > The VMS distributed lock manager provides the
> > synchronization mechanism needed to ensure
> > transparent and reliable data sharing between
> > nodes in a VAXcluster system. The lock
> > manager provides services for mutual exclusion
> > and event notification, and achieves high
> > performance by minimizing the number of messages
> > sent between nodes. The lock manager also
> > handles deadlock situations with a minimum
> > of messages exchanged. Since processors systems
> > can join or leave a cluster at any time, a
> > connection manager was developed to handle
> > reconfigurations in a dynamic, efficient manner.
>
> It should be noted that the Pathworks implementation works nicely for serving to PCs as it is a single process based implementation.
>
> Samba/CIFS in a multi-process implementation as is PostgreSQL and so there is then the need to coordinate between processes as well as between cluster members. It would also be nice to be able to access the files from the VMS host...
>
> It should also be noted that even Samba, and I expect PostgreSQL as well, implements its own byte range locking due to limitations in the fcntl() function call to allow access to LARGE files. So even there we have to consider some interesting issues. Samba implements an opportunistic locking mechanism which allows a client to have a cached, local copy of the file until such time as a second client comes along... This is not supported by VMS obviously. And is only supported by a few hosts as of now, from what I can tell. Samba also supports the deny-mode locks of Windows.
>
> So, no matter what we do we will need to see how we can accommodate the locking in a way that eventually we can access from VMS as well as the clients.
>
> Bill.
Do the existing (or newly imagined) Open Source uses of byte-range locking involve multi-threaded process contexts in which multiple, independent user-mode threads within the same process may attempt to access a particular byte range for a particular file?
The reason I ask is that the OpenVMS System Services locking API as represented by SYS$ENQ(W),SYS$DEQ, SYS$GETLKI, and SYS$SET_RESOURCE_DOMAIN grant, convert, snapshot, and destroy OpenVMS Resource Lock and Domain state at the process level. If multi-threading is potentially in play, then there will also need to be code written as part of this hypothetical byte-range locking API that can specifically deal with such multi-threading contexts so that multiple threads can independently (and transparently) manipulate Resource Locks and Domains (when necessary).
Apologies in advance if this complicates any hypothetical implementation. :)