Tuesday, October 22, 2024

A MySQL 9.1.0 branch with patches

Following-up on the previous MySQL 9.0.0 branch with patches, I have rebased them on 9.1.0: patched-mysql-9.1.0.

The set of the patches is the same as for 9.0.0: it improves AddressSanitizer support and fixes/improves clone plugin to support a second transactional storage engine:

  1. Fix for Bug 115120: Provide memory debugging macro implementations for AddressSanitizer.
  2. Fix for Bug 109922: SEs do not coordinate clone rollbacks on instance startup.
  3. Fix for Bug 109920: SEs cannot add to clone data size estimates.
  4. Fix for Bug 109919: Clone plugin does not support arbitrary length O_DIRECT files.
  5. Fix for Bug 107715: Multiple SE clone not calling clone_end after mixed clone_begin failure/success.
  6. Fix for Bug 106750: Some clone tests needlessly marked as Linux-only.
  7. Fix for Bug 106737: Wrong SE called to ack clone application if >1 SE.

Friday, October 18, 2024

Building and testing MySQL 8.0.40 / 8.4.3 / 9.1.0 on macOS

Congrats to Oracle friends with MySQL 8.0.40 / 8.4.3 / 9.1.0 releases! Let's continue my blog post series on builds and tests on macOS (the previous post for MySQL 8.0.38 / 8.4.1 / 9.0.0 is here. I skipped the emergency hotfixes 8.0.39 / 8.4.2 / 9.0.1).

Build

Mostly good news here. XCode 16 works (8.4.3 & 9.10 need -Wno-unused-const-variable), and so does LLVM 18. The very recent LLVM 19 release will need fixes for the new errors (and not only warnings which could be disabled), but that's expected. Homebrew LLVM still needs the workaround to avoid mixing system and Homebrew LLVM static linker utilities (Bug #113113 Build failure with Homebrew LLVM 14-19 on macOS). All releases build with maximum system libraries, good.

Test

Many changes here. Several existing bugs have been fixed, but there are also new regressions. As usual, I tested Release, Debug, and Debug+ASan+UBSan configurations.

New bugs

Little or no changes

Fixed and no longer reproducing bugs:

Totals

To sum up the existing build & test bugs, we have 10 new, 11 unchanged, and 8 fixed bugs. A lot of churn, and still plus two regressions total.

Newer tooling

I have also logged two bugs which seem to be new classes of errors from newer tooling instead of being MySQL regressions, i.e. they are very likely present in older versions too. These I don't count in the above, but will start doing so from the next releases:

Valgrind

I have been complaining that running Valgrind is excessively slow, and that there was an error present on every test (Bug #115229 pwrite(buf) points to uninitialised byte(s) in os_fusionio_get_sector_size()). The good news is that this bug has been fixed, making the Valgrind runs actually usable now. I have started one for 9.1.0, will see how far along it goes.

One-off issues that I couldn't handle better

Stuff I couldn't repeat reliably or at all, just dumping it here in case I have to reference it next time.

  • rpl_nogtid.rpl_semi_sync_non_group_commit_deadlock 8.0.40 Debug+San reports odr-violation on ReplSemiSyncBase::kPacketMagicNum, does not reproduce running individually
  • binlog.binlog_mysqlbinlog_raw failed once on 8.0.40 Debug+San (L77 copy_file error)
  • rpl_gtid.rpl_gtids_table_disable_binlog_on_slave failed once on 8.4.3 Debug+San build
  • main.index_merge_innodb_hypergraph failed once on 8.4.3 Debug+San build
  • innodb.trigger_function_lock_compare timed out once there
  • auth_sec.grant_as_ddl failed once 8.4.3 Release build
  • rpl_gtid.rpl_gtids_table_disable_binlog_on_slave failed once on 9.1.0 Debug+San build
  • merge_innodb_tests-t failed once on 9.1.0 Debug+San
  • main.lock_backup failed once 9.1.0 with MTR thread id masking clobbering error number
  • innodb.trigger_function_lock_compare failed once on 9.1.0 Debug

Conclusion

I am happy to see that some of the bugs are getting fixed, but the trend is still going the wrong way, and I miss the fully-clean mid-8.0 releases.

Thursday, October 10, 2024

Emacs Projectile Tweaks for MySQL Development

I am using Emacs with Projectile (besides other packages) for MySQL development. Here's a couple of little tweaks to save a few keystrokes here and there:

  • Visit (which in Emacs parlance means open) the MTR test file, by its MTR name instead of file path:
;; This is a not a MySQL-specific implementation of `projectile-find-test-file'.
;; That function is meant for jumping from a source file to its test file.
;; TODO(laurynas): this is not an exhaustive implementation for all locations
;; test files can reside. Add them as the need arises.
(defun my-visit-mtr-test ()
  "Input MySQL MTR test name and visit it."
  (interactive)
  (let* ((input (read-string "MySQL MTR test name: "))
         ;; TODO(laurynas): error checking
         (parts (split-string input "\\."))
         (suite-name (car parts))
         (test-in-suite (concat "t/" (cadr parts) ".test"))
         (test-root (concat (projectile-project-root) "mysql-test/"))
         (file-path (if (string= suite-name "main")
                        (concat test-root test-in-suite)
                      (concat test-root "suite/" suite-name "/"
                              test-in-suite))))
    (find-file file-path)))

(define-key projectile-command-map "M" #'my-visit-mtr-test)

The last line binds this command to M in the Projectile command map, so if your Projectile keybinding prefix is C-c p (C is Ctrl in case non-Emacs users are still reading), you can do C-c p M to invoke it.

  • Register .test and .result files as "other file types" for each other. This way projectile-find-other-file (at e.g. C-c p a) can be used for quick jumping between tests and their results:
(add-to-list 'projectile-other-file-alist '("test" "result"))
(add-to-list 'projectile-other-file-alist '("result" "test"))

If I think of more utilities, I'll try not to forget to update this post.