Whamcloud - gitweb
LUDOC-266 protocol: Initial content for new repository 30/13430/14
authorAndrew C. Uselton <andrew.c.uselton@intel.com>
Fri, 16 Jan 2015 03:31:51 +0000 (19:31 -0800)
committerAndrew Uselton <andrew.c.uselton@intel.com>
Wed, 18 Feb 2015 21:49:47 +0000 (21:49 +0000)
Initial content for the new 'protocol' repository.

The primary 'source' content in this repository is a collection of
text files ('*.txt') in the 'asciidoc' format, augmented with some
figures constructed with 'graphviz' ('*.gv'). 'asciidoc' will
produce '.html', '.pdf', and '.xml' (DocBook) files. 'graphviz'
('dot' actually) will produce '.png' files. The '.gitignore' file
lists these derived file extensions so the 'compiled' results will
not be a part of the repository contents, but instead will be build
afresh when needed.

In the 'figures' directory there is one '.gv' file (mkdir1.gv) that attempts to
capture some ideas about one state machine. It is an early effort at
this point.

The Makefile generates two commonly desirable output formats from
the source. These are .html and .pdf.

Signed-off-by: Andrew C. Uselton <andrew.c.uselton@intel.com>
Change-Id: I7a2ac74e64d581f05ca15fd4b1f12b83634f72df
Reviewed-on: http://review.whamcloud.com/13430
Reviewed-by: Olaf Faaland-LLNL <faaland1@llnl.gov>
Reviewed-by: Richard Henwood <richard.henwood@intel.com>
Tested-by: Jenkins
.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
build/whitespace.sh [new file with mode: 0755]
figures/mkdir1.gv [new file with mode: 0644]
protocol.txt [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..4686d86
--- /dev/null
@@ -0,0 +1,12 @@
+*~
+\#*
+.\#*
+*.aux
+*.bbl
+*.blg
+*.log
+*.pdf
+*.html
+*.png
+*.xml
+*.bak
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..ed552c0
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,26 @@
+FIGURES = figures/mkdir1.png
+
+.SUFFIXES : .gnuplot .gv .pdf .png
+
+.PHONY: all
+all: protocol.html protocol.pdf
+
+.PHONY: check
+check: protocol.txt
+       @echo "Are there lines with trailing white space?"
+       build/whitespace.sh $<
+
+protocol.html: $(FIGURES) protocol.txt
+       asciidoc protocol.txt
+
+protocol.pdf: $(FIGURES) protocol.txt
+       a2x -f pdf --fop protocol.txt
+
+.gv.png:
+       dot -Tpng $< -o $@
+
+.PHONY : clean
+clean:
+       rm -f *.xml *.html *.pdf figures/*.png
+
+
diff --git a/build/whitespace.sh b/build/whitespace.sh
new file mode 100755 (executable)
index 0000000..38a7360
--- /dev/null
@@ -0,0 +1,16 @@
+#!/bin/bash
+# whitespace.sh
+# Remove whitespace at the end of lines. This could go directly in the
+# Makefile if suitably quoted, but getting the quoting just right is
+# both fussy and makes the action less readable.
+# [2015-01-23]
+# I needed to remove _all_ the space, not just the last instance.
+# -Andrew
+
+for file in $@
+do
+    echo "$file: "
+    sed -i.bak -E "s/[[:space:]]*$//" $file
+    diff $file ${file}.bak
+done
+
diff --git a/figures/mkdir1.gv b/figures/mkdir1.gv
new file mode 100644 (file)
index 0000000..fd73cbb
--- /dev/null
@@ -0,0 +1,106 @@
+digraph mkdir1 {
+    compound=true;
+    subgraph cluster0 {
+        node [style=filled,color=white];
+        style=filled;
+        cli0 [label="idle client"];
+        cli1 [label="waiting\non mkdir"];
+        cli2 [style=invis];
+        cli3 [style=invis];
+        cli4 [style=invis];
+        cli5 [style=invis];
+        cli6 [style=invis];
+        cli7 [style=invis];
+        cli8 [style=invis];
+        cli0 -> cli1 [label="start\nmkdir"];
+        cli1 -> cli0 [label="mkdir\ncomplete"];
+        label = "client";
+        color=lightgrey;
+    }
+    subgraph cluster1 {
+        node [style=filled,color=white];
+        style=filled;
+        label = "MDS thread";
+        color=lightgrey;
+        mds0 [label="idle\nMDS\nthread"];
+        mds1 [label="mkdir request\nhas arrived"];
+        mds2 [label="lock\nacquired"];
+        mds3 [label="memory\nupdates\ncomplete"];
+        mds7 [label="metadata\nupdate\ncomplete"];
+        mds8 [label="lock\nreleased"];
+       mds0 -> mds1 [label="start\nmkdir"];
+       mds1 -> mds2 [label="lock"];
+       mds2 -> mds3 [label="memory\nupdate\ntransaction"];
+        subgraph cluster4 {
+            node [style=filled,color=white];
+            style=filled;
+            cn4 [label="ready to\nnotify client"];
+            cn5 [label="client\nnotified"];
+            cn4 -> cn5 [label="mkdir\ncomplete"]; 
+            label = "Client notification";
+           color=lightblue;
+        }
+        subgraph cluster5 {
+            node [style=filled,color=white];
+            style=filled;
+            du4 [label="ready to\nwrite to\ndisk"];
+            du5 [label="writing\nto disk"];
+            du6 [label="disk\nwrite\ncomplete"];
+            du4 -> du5 [label="start\nwrite"]; 
+            du5 -> du6 [label="finish\nwrite"]; 
+            label = "Disk Update";
+           color=lightblue;
+        }
+       mds3 -> cn4 [style=dotted,lhead=cluster4];
+       mds3 -> du4 [style=dotted,lhead=cluster5];
+       cn5 -> mds7 [style=dotted,ltail=cluster4];
+       du6 -> mds7  [style=dotted,ltail=cluster5];
+       mds7-> mds8 [label="unlock"];
+       mds8 -> mds0;
+        label = "MDS";
+       color=lightgrey;
+    }
+    subgraph cluster2 {
+        node [style=filled,color=white];
+        style=filled;
+        ldlm0 [label=unlocked];
+        ldlm1 [label="locked"];
+        ldlm2 [style=invis];
+        ldlm3 [style=invis];
+        ldlm4 [style=invis];
+        ldlm5 [style=invis];
+        ldlm6 [style=invis];
+        ldlm7 [style=invis];
+        ldlm8 [style=invis];
+        ldlm0 -> ldlm1 [label="lock"];
+        ldlm1 -> ldlm0 [label="unlock"];
+        label = "LDLM";
+        color=lightgrey;
+    }
+    subgraph cluster3 {
+        node [style=filled,color=white];
+        style=filled;
+        disk0 [label="idle disk"];
+        disk1 [label="active disk"];
+        disk2 [style=invis];
+        disk3 [style=invis];
+        disk4 [style=invis];
+        disk5 [style=invis];
+        disk6 [style=invis];
+        disk7 [style=invis];
+        disk8 [style=invis];
+        disk0 -> disk1 [label="start\nwrite"]; 
+        disk1 -> disk0 [label="write\ncomplete"]; 
+        label = "Disk";
+       color=lightgrey;
+    }
+    {rank = same; mds0; cli0; ldlm0; disk0; }
+    {rank = same; mds1; cli1; ldlm1; disk1; }
+    {rank = same; mds2; cli2; ldlm2; disk2; }
+    {rank = same; mds3; cli3; ldlm3; disk3; }
+    start -> cli0;
+    start -> mds0;
+    start -> ldlm0;
+    start -> disk0;
+    start [shape=Mdiamond];
+}
diff --git a/protocol.txt b/protocol.txt
new file mode 100644 (file)
index 0000000..4b3df34
--- /dev/null
@@ -0,0 +1,350 @@
+Lustre Protocol Documentation
+=============================
+Andrew Uselton <andrew.c.uselton@intel.com>
+v0.0, January 2015
+:author: Andrew Uselton
+:doctype: article
+:Author Initials: ACU
+:toc:
+:icons:
+:numbered:
+:imagesdir: ./figures
+:website: http://lustre.org/
+:keywords: PtlRPC, Lustre, Protocol
+
+
+:numbered!: [abstract] Abstract -------- The Lustre parallel file
+system <<lustre>> provides a global POSIX <<POSIX>> namespace for the
+computing resources of a data center. Lustre runs on Linux-based hosts
+via kernel modules, and delegates block storage management to the
+back-end servers while providing object-based storage to its
+clients. Servers are responsible for both data objects (the contents
+of actual files) and index objects (for directory information). Data
+objects are gathered on Object Storage Servers (OSSs), and index
+objects are stored on MetaData Storage Servers (MDSs). Each back-end
+storage volume is a target with Object Storage Targets (OSTs) on OSSs,
+and MetaData Storage Targets (MDTs) on MDSs.  Clients assemble the
+data from the MDT(s) and OST(s) to present a single coherent
+POSIX-compliant file system. The clients and servers communicate and
+coordinate among themselves via network protocols. A low-level
+protocol, LNet, abstracts the details of the underlying networking
+hardware and presents a uniform interface, originally based on Sandia
+Portals <<PORTALS>>, to Lustre clients and servers. Lustre, in turn,
+layers its own protocol PtlRPC atop LNet. This document describes the
+Lustre protocols, including how they are implemeted via PtlRPC and the
+Lustre Distributed Lock Manager (based on the VAX/VMS Distributed Lock
+Manager <<VAX_DLM>>). This document does not describe Lustre itself in
+any detail, except where doing so explains concepts that allow this
+document to be self-contained.
+
+:numbered:
+
+Overview
+--------
+
+'Content to be provided'
+
+Messages
+--------
+
+These are the messages that traverse the network using PTLRPC.
+
+[NOTE]
+This initial list combines some actual message names or types with the
+POSIX semantic operations they are being used to implement, as well as
+a few other underlying mechanisms (cf. "grant"). A subsequent
+refinement will separate the various items and relate them to one
+another.
+
+Client-MDS RPCs for POSIX namespace operations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+'Content to be provided'
+
+=== mount ===
+
+'Content to be provided'
+
+=== unmount ===
+
+'Content to be provided'
+
+=== create ===
+
+'Content to be provided'
+
+=== open ===
+
+'Content to be provided'
+
+=== close ===
+
+'Content to be provided'
+
+=== unlink ===
+
+'Content to be provided'
+
+=== mkdir ===
+
+image:mkdir1.png[mkdir]
+
+=== rmdir ===
+
+'Content to be provided'
+
+=== rename ===
+
+'Content to be provided'
+
+=== link ===
+
+'Content to be provided'
+
+=== symlink ===
+
+'Content to be provided'
+
+=== getattr ===
+
+'Content to be provided'
+
+=== setattr ===
+
+'Content to be provided'
+
+=== statfs ===
+
+'Content to be provided'
+
+=== ... ===
+
+'Content to be provided'
+
+
+Client-MDS RPCs for internal state management
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+'Content to be provided'
+
+=== connect ===
+
+'Content to be provided'
+
+=== disconnect ===
+
+'Content to be provided'
+
+=== FLD ===
+
+'Content to be provided'
+
+=== SEQ ===
+
+'Content to be provided'
+
+=== PING ===
+
+'Content to be provided'
+
+=== LDLM ===
+
+'Content to be provided'
+
+=== ... ===
+
+'Content to be provided'
+
+Client-OSS RPCs for IO Operations
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+'Content to be provided'
+
+=== read ===
+
+'Content to be provided'
+
+=== write ===
+
+'Content to be provided'
+
+=== truncate ===
+
+'Content to be provided'
+
+=== setattr ===
+
+'Content to be provided'
+
+=== grant ===
+
+'Content to be provided'
+
+=== ... ===
+
+'Content to be provided'
+
+MDS-OSS RPCs for internal state management
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+'Content to be provided'
+
+=== object precreation ===
+
+'Content to be provided'
+
+=== orphan recovery ===
+
+'Content to be provided'
+
+=== UID/GID change ===
+
+'Content to be provided'
+
+=== unlink ===
+
+'Content to be provided'
+
+=== ... ===
+
+'Content to be provided'
+
+MDS-OSS RPCs for quota management
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+'Content to be provided'
+
+
+MDS-OSS OUT RPCs for distributed updates
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+'Content to be provided'
+
+=== DNE1 remote directories ===
+
+'Content to be provided'
+
+=== DNE2 striped directories ===
+
+'Content to be provided'
+
+=== LFSCK2/3 verification and repair ===
+
+'Content to be provided'
+
+Message Flows
+-------------
+
+  Each file operation (in Lustre) generates a set of messages in a
+  particular sequence. There is one sequence for any particular
+  concrete operation, but under varying circumstances the same file
+  operation may generate a different sequence.
+
+State Machines
+--------------
+
+  For each File operation, the collection of possible sequences of
+  messages is governed by a state machine.
+
+:numbered!:
+
+[glossary]
+Glossary
+--------
+Here are some common terms used in discussing Lustre, POSIX semantics,
+and the prtocols used to implement them.
+
+[glossary]
+Object Storage Server::
+  An object storage server (OSS) is a computer responsible for
+  running Lustre kernel services in support of managing bulk data
+  objects on the underlying storage. There can be multiple OSSs in a
+  Lustre file system.
+
+MetaData Server::
+  A metadata server (MDS) is a computer responsible for running the
+  Lustre kernel services in support of managing the POSIX-compliant
+  name space and the indices associating files in that name space with
+  the locations of their corresponding objects. As of v2.4 there can
+  be multiple MDSs in a Lustre file system.
+
+Object Storage Target::
+  An object storage target (OST) is the service provided by an OSS
+  that mediates the placement of data objects on the specific
+  underlying file system hardware. There can be multiple OSTs on a
+  given OSS.
+
+MetaData Target::
+  A metadata target (MDT) is the service provided by an MDS that
+  mediates the management of name space indices on the underlying file
+  system hardware. As of v2.4 there can be multiple MDTs on an MDS.
+
+server::
+  A computer providing a service, such as an OSS or an MDS
+
+target::
+  Storage available to be served, such as an OST or an MDT. Also the
+  service being provided.
+
+protocol::
+  An agreed upon formalism for communicating between two entities,
+  such as between two servers or between a client and a server.
+
+client::
+  A computer taking advantage of a service provided by a server, such
+  as a Lustre client using MDS(s) and OSS(s) to assemble a
+  POSIX-compliant file system with its namespace and data storage
+  capabilities.
+
+PtlRPC::
+  The protocol (or set of protocols) implemented via RPCs that is
+  (are) employed by Lustre to communicate between its clients and
+  servers.
+
+Remote Procedure Call::
+  A mechanism for implementing operations involving one computer
+  acting on the behalf of another (RPC).
+
+LNet::
+  A lower level protocol employed by PtlRPC to abstract the mechanisms
+  provided by various hardware centric protocols, such as TCP or
+  Infiniband.
+
+[appendix]
+Concepts
+--------
+
+'Content to be provided'
+
+[appendix]
+License
+-------
+
+Copyright (C) Intel 2015
+
+This work is licensed under a Creative Commons Attribution-ShareAlike
+4.0 International License (CC BY-SA 4.0). See
+<https://creativecommons.org/licenses/by-sa/4.0/> for more detail.
+
+[bibliography]
+Bibliography
+------------
+Here is a selected list of references, including those cited in the
+foregoing text.
+
+[bibliography]
+- [[[lustre]]] 'Lustre'. http://lustre.opensfs.org
+- [[[POSIX]]] 'POSIX'. http://pubs.opengroup.org/onlinepubs/9699919799/
+- [[[PORTALS]]] 'The Portals 3.0 Message Passing
+               Interface Revision 1.1.'. Ron Brightwell, Trammel
+               Hudson, Rolf Riesen, and Arthur B. Maccabe. Technical
+               report, December 1999.
+- [[[VAX_DLM]]] 'The VAX/VMS Distributed Lock Manager'. W Snaman and
+               D Thiel.  Digital Technical Journal, September 1987.
+- [[[Barton_Dilger]]] 'Lustre'. Eric Barton and Andreas Dilger. A book
+                    on parallel file systems. Chapter 8. High
+                    Performance Parallel I/O, Prabhat and Quincey
+                    Koziol, Chapman and Hall/CRC Press, 2014, ISBN:
+                    978-1466582347.
+
+