@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Manually set "max_allowed_packet" to 1GB for "mysqldump"

Summary:
We have one production instance with failing database backups since they recently uploaded a 52MB hunk. The production configuration specifies a 64MB "max_allowed_packet" in `[mysqld]`, but this doesn't apply to `mysqldump` (we'd need to specify it in a separate `[mysqldump]` section) and `mysqldump` runs with an effective limit of the default (16MB).

We could change our production config to specify a value in `[mysqldump]`, but just change it unconditionally at execution time since there's no reason for any user to ever want this command to fail because they have too much data.

Test Plan: Dumped locally, will verify production backup goes through cleanly.

Reviewers: amckinley

Reviewed By: amckinley

Differential Revision: https://secure.phabricator.com/D18834

+16
+16
src/infrastructure/storage/management/workflow/PhabricatorStorageManagementDumpWorkflow.php
··· 187 187 $argv[] = '-h'; 188 188 $argv[] = $host; 189 189 190 + // MySQL's default "max_allowed_packet" setting is fairly conservative 191 + // (16MB). If we try to dump a row which is larger than this limit, the 192 + // dump will fail. 193 + 194 + // We encourage users to increase this limit during setup, but modifying 195 + // the "[mysqld]" section of the configuration file (instead of 196 + // "[mysqldump]" section) won't apply to "mysqldump" and we can not easily 197 + // detect what the "mysqldump" setting is. 198 + 199 + // Since no user would ever reasonably want a dump to fail because a row 200 + // was too large, just manually force this setting to the largest supported 201 + // value. 202 + 203 + $argv[] = '--max-allowed-packet'; 204 + $argv[] = '1G'; 205 + 190 206 if ($port) { 191 207 $argv[] = '--port'; 192 208 $argv[] = $port;