[Zodb-checkins] SVN: ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/BlobStorage.py Add XXX about sorting based on st_mtime to determine "most recent" revision of a blob.

Chris McDonough chrism at plope.com
Sun Jun 12 01:56:39 EDT 2005


Log message for revision 30757:
  Add XXX about sorting based on st_mtime to determine "most recent" revision of a blob.
  

Changed:
  U   ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/BlobStorage.py

-=-
Modified: ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/BlobStorage.py
===================================================================
--- ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/BlobStorage.py	2005-06-11 17:13:31 UTC (rev 30756)
+++ ZODB/branches/ctheune-blobsupport/src/ZODB/Blobs/BlobStorage.py	2005-06-12 05:56:37 UTC (rev 30757)
@@ -115,6 +115,15 @@
         serials.sort(lambda x,y: cmp(os.stat(x).st_mtime, 
                                      os.stat(y).st_mtime)
                      )
+
+        # XXX the above sort is inadequate for files written within
+        # the same second at least under UNIX (st_mtime has a 1-second
+        # resolution).  We should really try to make it an invariant
+        # that the filenames be sortable instead.  This is the case
+        # right now due to ever-increasing tid values, but that's
+        # presumably an implementation detail, and also relies on the
+        # clock never going backwards.
+
         return self._splitBlobFilename(serials[-1])[1]
 
     def pack(self, packtime, referencesf):



More information about the Zodb-checkins mailing list