Title: [253066] trunk/Tools
Revision
253066
Author
[email protected]
Date
2019-12-03 15:25:05 -0800 (Tue, 03 Dec 2019)

Log Message

results.webkit.org: Decrease ttl for archives
https://bugs.webkit.org/show_bug.cgi?id=204806
<rdar://problem/57527644>

Reviewed by Aakash Jain.

Make the ttl on the archive tables shorter, drop the existing table and create new ones
with a shorter ttl.

* resultsdbpy/resultsdbpy/model/archive_context.py:
(ArchiveContext.ArchiveMetaDataByCommit): Define new ArchiveMetaDataByCommit table.
(ArchiveContext.ArchiveChunks): Ditto.
* resultsdbpy/resultsdbpy/model/model.py:
(Model.__init__): Add archive ttl, 8 weeks by default.

Modified Paths

Diff

Modified: trunk/Tools/ChangeLog (253065 => 253066)


--- trunk/Tools/ChangeLog	2019-12-03 23:17:44 UTC (rev 253065)
+++ trunk/Tools/ChangeLog	2019-12-03 23:25:05 UTC (rev 253066)
@@ -1,3 +1,20 @@
+2019-12-03  Jonathan Bedard  <[email protected]>
+
+        results.webkit.org: Decrease ttl for archives
+        https://bugs.webkit.org/show_bug.cgi?id=204806
+        <rdar://problem/57527644>
+
+        Reviewed by Aakash Jain.
+
+        Make the ttl on the archive tables shorter, drop the existing table and create new ones
+        with a shorter ttl.
+
+        * resultsdbpy/resultsdbpy/model/archive_context.py:
+        (ArchiveContext.ArchiveMetaDataByCommit): Define new ArchiveMetaDataByCommit table.
+        (ArchiveContext.ArchiveChunks): Ditto.
+        * resultsdbpy/resultsdbpy/model/model.py:
+        (Model.__init__): Add archive ttl, 8 weeks by default.
+
 2019-12-03  Christopher Reid  <[email protected]>
 
         Regular _expression_ hangs in Safari only

Modified: trunk/Tools/resultsdbpy/resultsdbpy/model/archive_context.py (253065 => 253066)


--- trunk/Tools/resultsdbpy/resultsdbpy/model/archive_context.py	2019-12-03 23:17:44 UTC (rev 253065)
+++ trunk/Tools/resultsdbpy/resultsdbpy/model/archive_context.py	2019-12-03 23:25:05 UTC (rev 253066)
@@ -52,7 +52,7 @@
     MEMORY_LIMIT = 2 * 1024 * 1024 * 1024  # Don't allow more than 2 gigs of archives in memory at one time
 
     class ArchiveMetaDataByCommit(ClusteredByConfiguration):
-        __table_name__ = 'archive_metadata_by_commit'
+        __table_name__ = 'archive_metadata_by_commit_01'
         suite = columns.Text(partition_key=True, required=True)
         branch = columns.Text(partition_key=True, required=True)
         uuid = columns.BigInt(primary_key=True, required=True, clustering_order='DESC')
@@ -72,7 +72,7 @@
     # According to https://cwiki.apache.org/confluence/display/CASSANDRA2/CassandraLimitations, we should shard
     # large data blobs.
     class ArchiveChunks(Model):
-        __table_name__ = 'archive_chunks'
+        __table_name__ = 'archive_chunks_01'
         digest = columns.Text(partition_key=True, required=True)
         index = columns.Integer(primary_key=True, required=True)
         chunk = columns.Blob(required=True)

Modified: trunk/Tools/resultsdbpy/resultsdbpy/model/model.py (253065 => 253066)


--- trunk/Tools/resultsdbpy/resultsdbpy/model/model.py	2019-12-03 23:17:44 UTC (rev 253065)
+++ trunk/Tools/resultsdbpy/resultsdbpy/model/model.py	2019-12-03 23:25:05 UTC (rev 253066)
@@ -38,10 +38,13 @@
     TTL_WEEK = 7 * TTL_DAY
     TTL_YEAR = 365 * TTL_DAY
 
-    def __init__(self, redis, cassandra, repositories=[], default_ttl_seconds=TTL_YEAR * 5, async_processing=False):
+    def __init__(self, redis, cassandra, repositories=[], default_ttl_seconds=TTL_YEAR * 5, archive_ttl_seconds=TTL_WEEK * 8, async_processing=False):
         if default_ttl_seconds is not None and default_ttl_seconds < 4 * self.TTL_WEEK:
             raise ValueError('TTL must be at least 4 weeks')
+        if archive_ttl_seconds is not None and archive_ttl_seconds < 2 * self.TTL_WEEK:
+            raise ValueError('Archive TTL must be at least 2 weeks')
         self.default_ttl_seconds = default_ttl_seconds
+        self.archive_ttl_seconds = archive_ttl_seconds or default_ttl_seconds
         self._async_processing = async_processing
 
         self.redis = redis
@@ -84,7 +87,7 @@
         self.archive_context = ArchiveContext(
             configuration_context=self.configuration_context,
             commit_context=self.commit_context,
-            ttl_seconds=self.default_ttl_seconds,
+            ttl_seconds=self.archive_ttl_seconds,
         )
 
     def do_work(self):
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to