]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Make MDMF the default mutable format. refs ticket:2227
authorDaira Hopwood <daira@jacaranda.org>
Tue, 11 Aug 2015 17:24:33 +0000 (18:24 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Tue, 11 Aug 2015 17:24:33 +0000 (18:24 +0100)
Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/client.py
src/allmydata/mutable/layout.py
src/allmydata/scripts/debug.py
src/allmydata/web/directory.py
src/allmydata/web/root.py
src/allmydata/web/welcome.xhtml

index bb6dce23096d4d0af7b89973af4e08394a0a460b..c3b5beb745a4b1266b36cbef7b34e513c72ba7c9 100644 (file)
@@ -382,7 +382,7 @@ class Client(node.Node, pollmixin.PollMixin):
         self.blacklist = Blacklist(fn)
 
     def init_nodemaker(self):
-        default = self.get_config("client", "mutable.format", default="SDMF")
+        default = self.get_config("client", "mutable.format", default="MDMF")
         if default.upper() == "MDMF":
             self.mutable_file_default = MDMF_VERSION
         else:
index b938794f947281428e5c8ba16fa57880df4faa08..492d48cb1f9a6718d3ba77fa13d2d05255fc0223 100644 (file)
@@ -74,7 +74,7 @@ OFFSETS_LENGTH = struct.calcsize(OFFSETS)
 MAX_MUTABLE_SHARE_SIZE = 69105*1000*1000*1000*1000 # 69105 TB, kind of arbitrary
 
 
-# These are still used for some tests of SDMF files.
+# These are still used for some tests.
 def unpack_header(data):
     o = {}
     (version,
index 738f911e39307b60a35b6ae07b92bfe307de5c79..a601594b1855b8bee7beeb7954723b9b1a4028f6 100644 (file)
@@ -919,14 +919,11 @@ def corrupt_share(options):
         f = open(fn, "rb")
         f.seek(m.DATA_OFFSET)
         data = f.read(2000)
-        # make sure this slot contains an SMDF share
-        assert data[0] == "\x00", "non-SDMF mutable shares not supported"
         f.close()
 
         (version, ig_seqnum, ig_roothash, ig_IV, ig_k, ig_N, ig_segsize,
          ig_datalen, offsets) = unpack_header(data)
 
-        assert version == 0, "we only handle v0 SDMF files"
         start = m.DATA_OFFSET + offsets["share_data"]
         end = m.DATA_OFFSET + offsets["enc_privkey"]
         flip_bit(start, end)
index d82bf643600751957a97e390bc5509970dd8f9b8..2f92841f37426fc94c8fc14036b9e634cc61b23d 100644 (file)
@@ -17,7 +17,7 @@ from allmydata.util.encodingutil import to_str
 from allmydata.uri import from_string_dirnode
 from allmydata.interfaces import IDirectoryNode, IFileNode, IFilesystemNode, \
      IImmutableFileNode, IMutableFileNode, ExistingChildError, \
-     NoSuchChildError, EmptyPathnameComponentError, SDMF_VERSION, MDMF_VERSION
+     NoSuchChildError, EmptyPathnameComponentError, MDMF_VERSION, SDMF_VERSION
 from allmydata.blacklist import ProhibitedNode
 from allmydata.monitor import Monitor, OperationCancelledError
 from allmydata import dirnode
@@ -803,11 +803,11 @@ class DirectoryAsHTML(rend.Page):
         if self.dirnode_children is None:
             return T.div["No upload forms: directory is unreadable"]
 
+        mkdir_mdmf = T.input(type='radio', name='format',
+                             value='mdmf', id='mkdir-mdmf')
         mkdir_sdmf = T.input(type='radio', name='format',
                              value='sdmf', id='mkdir-sdmf',
                              checked='checked')
-        mkdir_mdmf = T.input(type='radio', name='format',
-                             value='mdmf', id='mkdir-mdmf')
 
         mkdir_form = T.form(action=".", method="post",
                             enctype="multipart/form-data")[
@@ -818,8 +818,8 @@ class DirectoryAsHTML(rend.Page):
             "New directory name:"+SPACE, T.br,
             T.input(type="text", name="name"), SPACE,
             T.div(class_="form-inline")[
-                mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[SPACE, "SDMF"], SPACE*2,
-                mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[SPACE, "MDMF (experimental)"]
+                mkdir_mdmf, T.label(for_='mutable-directory-mdmf')[SPACE, "MDMF"], SPACE*2,
+                mkdir_sdmf, T.label(for_='mutable-directory-sdmf')[SPACE, "SDMF"]
             ],
             T.input(type="submit", class_="btn", value="Create")
             ]]
@@ -828,10 +828,10 @@ class DirectoryAsHTML(rend.Page):
         upload_chk  = T.input(type='radio', name='format',
                               value='chk', id='upload-chk',
                               checked='checked')
-        upload_sdmf = T.input(type='radio', name='format',
-                              value='sdmf', id='upload-sdmf')
         upload_mdmf = T.input(type='radio', name='format',
                               value='mdmf', id='upload-mdmf')
+        upload_sdmf = T.input(type='radio', name='format',
+                              value='sdmf', id='upload-sdmf')
 
         upload_form = T.form(action=".", method="post",
                              enctype="multipart/form-data")[
@@ -843,8 +843,8 @@ class DirectoryAsHTML(rend.Page):
             T.input(type="file", name="file", class_="freeform-input-file"), SPACE,
             T.div(class_="form-inline")[
                 upload_chk,  T.label(for_="upload-chk") [SPACE, "Immutable"], SPACE*2,
-                upload_sdmf, T.label(for_="upload-sdmf")[SPACE, "SDMF"], SPACE*2,
-                upload_mdmf, T.label(for_="upload-mdmf")[SPACE, "MDMF (experimental)"]
+                upload_mdmf, T.label(for_="upload-mdmf")[SPACE, "MDMF"],      SPACE*2,
+                upload_sdmf, T.label(for_="upload-sdmf")[SPACE, "SDMF"]
             ],
             T.input(type="submit", class_="btn", value="Upload"),             SPACE*2,
             ]]
index 8a9969c610f43a18097a8e904a3a19e35afa99d2..f4137eaa3496c526fc6eeb256ffd9550f7aff653 100644 (file)
@@ -348,15 +348,15 @@ class Root(rend.Page):
 
     def render_upload_form(self, ctx, data):
         # This is a form where users can upload unlinked files.
-        # Users can choose immutable, SDMF, or MDMF from a radio button.
+        # Users can choose immutable, MDMF, or SDMF from a radio button.
 
         upload_chk  = T.input(type='radio', name='format',
                               value='chk', id='upload-chk',
                               checked='checked')
-        upload_sdmf = T.input(type='radio', name='format',
-                              value='sdmf', id='upload-sdmf')
         upload_mdmf = T.input(type='radio', name='format',
                               value='mdmf', id='upload-mdmf')
+        upload_sdmf = T.input(type='radio', name='format',
+                              value='sdmf', id='upload-sdmf')
 
         form = T.form(action="uri", method="post",
                       enctype="multipart/form-data")[
@@ -365,9 +365,9 @@ class Root(rend.Page):
             T.div["Choose a file:"+SPACE,
                   T.input(type="file", name="file", class_="freeform-input-file")],
             T.input(type="hidden", name="t", value="upload"),
-            T.div[upload_chk,  T.label(for_="upload-chk") [" Immutable"],           SPACE,
-                  upload_sdmf, T.label(for_="upload-sdmf")[" SDMF"],                SPACE,
-                  upload_mdmf, T.label(for_="upload-mdmf")[" MDMF (experimental)"], SPACE*2,
+            T.div[upload_chk,  T.label(for_="upload-chk") [" Immutable"], SPACE,
+                  upload_mdmf, T.label(for_="upload-mdmf")[" MDMF"],      SPACE,
+                  upload_sdmf, T.label(for_="upload-sdmf")[" SDMF"],      SPACE*2,
                   T.input(type="submit", value="Upload!")],
             ]]
         return T.div[form]
@@ -376,18 +376,18 @@ class Root(rend.Page):
         # This is a form where users can create new directories.
         # Users can choose SDMF or MDMF from a radio button.
 
-        mkdir_sdmf = T.input(type='radio', name='format',
-                             value='sdmf', id='mkdir-sdmf',
-                             checked='checked')
         mkdir_mdmf = T.input(type='radio', name='format',
-                             value='mdmf', id='mkdir-mdmf')
+                             value='mdmf', id='mkdir-mdmf',
+                             checked='checked')
+        mkdir_sdmf = T.input(type='radio', name='format',
+                             value='sdmf', id='mkdir-sdmf')
 
         form = T.form(action="uri", method="post",
                       enctype="multipart/form-data")[
             T.fieldset[
             T.legend(class_="freeform-form-label")["Create a directory"],
-            mkdir_sdmf, T.label(for_='mkdir-sdmf')[" SDMF"],                SPACE,
-            mkdir_mdmf, T.label(for_='mkdir-mdmf')[" MDMF (experimental)"], SPACE*2,
+            mkdir_mdmf, T.label(for_='mkdir-mdmf')[" MDMF"], SPACE,
+            mkdir_sdmf, T.label(for_='mkdir-sdmf')[" SDMF"], SPACE*2,
             T.input(type="hidden", name="t", value="mkdir"),
             T.input(type="hidden", name="redirect_to_result", value="true"),
             T.input(type="submit", value="Create a directory"),
index 3e23fc736fa3446b09ae9560caa80d79fe44a5e7..c2b0cb27bdc1ac0ae42bcfb6396b8e0d50b8d3ae 100644 (file)
                   Immutable
                 </label>
 
+                <label for="upload-mdmf" class="radio">
+                  <input type="radio" id="upload-mdmf" value="mdmf" name="format" />
+                  <acronym title="Medium Distributed Mutable File">MDMF</acronym>
+                </label>
+
                 <label for="upload-sdmf" class="radio">
                   <input type="radio" id="upload-sdmf" value="sdmf" name="format" />
                   <acronym title="Small Distributed Mutable File">SDMF</acronym>
                 </label>
 
-                <label for="upload-mdmf" class="radio">
-                  <input type="radio" id="upload-mdmf" value="mdmf" name="format" />
-                  <acronym title="Medium Distributed Mutable File">MDMF</acronym> (experimental)
-                </label>
-
                 <p><input type="submit" class="btn" value="Upload File &#187;" /></p>
               </form>
             </div>
             <div class="nav-header">Create Directory</div>
             <div class="nav-form">
               <form action="uri" method="post" enctype="multipart/form-data">
+                <label for="mkdir-mdmf" class="radio">
+                  <input type="radio" id="mkdir-mdmf" value="mdmf" name="format" />
+                  <acronym title="Medium Distributed Mutable File">MDMF</acronym>
+                </label>
+
                 <label for="mkdir-sdmf" class="radio"> 
                   <input type="radio" checked="checked" id="mkdir-sdmf" value="sdmf" name="format" />
                   <acronym title="Small Distributed Mutable File">SDMF</acronym>
                 </label>
 
-                <label for="mkdir-mdmf" class="radio">
-                  <input type="radio" id="mkdir-mdmf" value="mdmf" name="format" />
-                  <acronym title="Medium Distributed Mutable File">MDMF</acronym> (experimental)
-                </label>
-
                 <input type="hidden" name="t" value="mkdir" />
                 <input type="hidden" name="redirect_to_result" value="true" />
                 <input type="submit" class="btn" value="Create a directory &#187;" />