Uploaded image for project: 'Project Quay'
  1. Project Quay
  2. PROJQUAY-4305

Change logentry3 metadata_json size on MySQL deployments

XMLWordPrintable

      Currently, the metadata_json column in the logentry3 table on MySQL deployments has a size of TEXT. According to this document:

      https://dev.mysql.com/doc/refman/8.0/en/storage-requirements.html#data-types-storage-reqs-strings

      the default size of the column set to be text is 65535 bytes. Unfortunately, this is not big enough for mirror logs when debugging is turned off. These can be up to 120 kB in size. When a statement containing text longer than 65535 bytes is sent to MySQL, data sent will be truncated to fit into the 65535 byte boundary. This creates issues when the metadata_json object is decoded, the decode fails because the string is not terminated properly and usage logs in Quay error out with a 500.

      The solution would be to increase the size of the logentry3 table's metadata_json column to at least MEDIUMTEXT which allows strings up to (2^24)-1 bytes or almost 16 MB in size. This would be enough to save the complete log in the table and would stop the 500 errors being generated when usage logs are read.

      ALTER TABLE logentry3 MODIFY metadata_json MEDIUMTEXT;
      

      This issue does not appear on PostgreSQL databases because it has only one text field and the length of data that can be saved is practically unlimited.

      Please check, thanks!

              sleesinc Kenny Lee Sin Cheong
              rhn-support-ibazulic Ivan Bazulic
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated:
                Resolved: