Uploaded image for project: 'Percona Server'
  1. Percona Server
  2. PS-4257

Optionally block/log queries relying on Gap Locks



      myrocks relies on several new functions in webscale for detecting, logging, and/or preventing gap locks which are not supported in myrocks. The entire patch is intended to allow users to run with innodb prior to migration to see if their app is using the unsupported locks and log when and where. It seems like a good patch to try and pull into 5.6 before porting to 5.7 as otherwise many of these helper functions will need to be re-implemented manually within myrocks to satisfy the need for safely detecting unsupported use.

      Confirmed that PS 5.7 is also subject to the <regex> issue in server body due to compiling < C++ 2011 :

      In file included from /usr/include/c++/4.8/regex:35:0,
                       from /ssd/percona/myrocks-import/percona-server/sql/handler.h:39,
                       from /ssd/percona/myrocks-import/percona-server/sql/sql_class.h:30,
                       from /ssd/percona/myrocks-import/percona-server/storage/example/ha_example.cc:90:
      /usr/include/c++/4.8/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.

      Upstream commits of interest in order of oldest first:
      https://github.com/facebook/mysql-5.6/commit/e851f8eb7ad2a0ca08a0518df0274974368a3677 : Framework to dump SQL statement that use gap locking in innodb
      https://github.com/facebook/mysql-5.6/commit/782cc5a4f4e2c18b2f961b78f4369f4d72c080c2 : Optionally block/log queries relying on Gap Locks
      https://github.com/facebook/mysql-5.6/commit/2fb6321d5cc239d63a66cc5a04bdb62a04794f6d : Checking Gap Lock for InnoDB and MyRocks only
      https://github.com/facebook/mysql-5.6/commit/6078c85bcceb09849971726c262570529bca8ece : Preventing to write "Got error 122.." to err log on Gap Lock errors
      https://github.com/facebook/mysql-5.6/commit/9b439ee4010d0db8f48b206bc16a53c1ea293744 : Add option to exclude tables from gap lock check ** Uses the Regex_list_handler up in server code mentioned in MYR-9 and unable to merge in
      https://github.com/facebook/mysql-5.6/commit/b62cee1fad43b1c0848d80d736689019bd8750e9 : Gap Lock: skip raising error if calling ha_rnd_init(0) (#254)
      https://github.com/facebook/mysql-5.6/commit/179bdf1b14b6b88b0661527eb039ae32cb1fc2ba : Issue #287: gap_lock_exceptions was not initialized at startup
      https://github.com/facebook/mysql-5.6/commit/03690d6807555ce6898ed4496785d0303a208f06 : Refactor regex code to handle regexes in table lists easier ** Basis for MYR-9
      https://github.com/facebook/mysql-5.6/commit/fbd5a3c246e0946f1eec4363ad2305e2c866a808 : Suppress Gap Lock errors for unique key lookups


        Smart Checklist




              • Assignee:
                george.lorch George Lorch
                george.lorch George Lorch
              • Votes:
                0 Vote for this issue
                2 Start watching this issue


                • Created: