Change job table params from blob to mediumblob
authorErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 1 Apr 2019 16:05:08 +0000 (09:05 -0700)
committerErik Bernhardson <ebernhardson@wikimedia.org>
Mon, 1 Apr 2019 16:07:35 +0000 (09:07 -0700)
The default blob type holds 65kB which is often enough, but some
jobs push over this limit. When using mysql these are silently
truncated to 65kB which only issues errors when the data is retrieved.

Increase from blob to mediumblob which gives a max size of 16MB. There
may be some valid use cases for jobs > 64kB, but there should be no
use case for jobs > 16MB.

Bug: T124196
Change-Id: I6df6634bd3a5b5fa27ce6f8ff20d251a9b5eba32

includes/installer/MysqlUpdater.php
maintenance/archives/patch-job-params-mediumblob.sql [new file with mode: 0644]
maintenance/tables.sql

index 2e3fdba..c33d3dd 100644 (file)
@@ -375,6 +375,7 @@ class MysqlUpdater extends DatabaseUpdater {
                        [ 'dropTable', 'valid_tag' ],
                        [ 'dropTable', 'tag_summary' ],
                        [ 'dropField', 'protected_titles', 'pt_reason', 'patch-drop-comment-fields.sql' ],
+                       [ 'modifyTable', 'job', 'patch-job-params-mediumblob.sql' ],
                ];
        }
 
diff --git a/maintenance/archives/patch-job-params-mediumblob.sql b/maintenance/archives/patch-job-params-mediumblob.sql
new file mode 100644 (file)
index 0000000..19fe0b6
--- /dev/null
@@ -0,0 +1,2 @@
+ALTER TABLE /*$wgDBprefix*/job
+MODIFY COLUMN job_params mediumblob NOT NULL;
index dac222f..0739666 100644 (file)
@@ -1683,7 +1683,7 @@ CREATE TABLE /*_*/job (
 
   -- Any other parameters to the command
   -- Stored as a PHP serialized array, or an empty string if there are no parameters
-  job_params blob NOT NULL,
+  job_params mediumblob NOT NULL,
 
   -- Random, non-unique, number used for job acquisition (for lock concurrency)
   job_random integer unsigned NOT NULL default 0,