<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/mariadb-git.git, branch bb-10.5-mdev_742</title>
<subtitle>github.com: MariaDB/server.git
</subtitle>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/'/>
<entry>
<title>MDEV-742: read-only, pure myisam, binlog-*, @@skip_log_bin corner cases</title>
<updated>2020-03-15T15:04:29+00:00</updated>
<author>
<name>Andrei Elkin</name>
<email>andrei.elkin@mariadb.com</email>
</author>
<published>2020-03-08T19:52:30+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=dc9057184296583af86522c12c27204401819c75'/>
<id>dc9057184296583af86522c12c27204401819c75</id>
<content type='text'>
(Pushed to 10.5)
Are addressed along the following policies.
Prepared read-only, or on non-transactional engines, or
binlog-* filter in binlog, or skipped to binlog XA:s remains in the xid cache after disconnect.
But their consequent completion with Commit or Rollback differs.

1. The read-only at reconnect marks XID to fail for future
completion with ER_XA_RBROLLBACK.

2. `binlog-*` filtered XA when it changes engine data is regarded
as loggable even when nothing got cached for binlog.
An empty XA-prepare group is recorded. Consequent Commit-or-Rollback
succeeds in the Engine(s) as well as recorded into binlog.

3. The same applies to the non-transactional engine XA.

4. @@skip_log_bin=OFF does not record anything at XA-prepare (obviously),
but the completion event is recorded into binlog to admit
inconsistency with slave.

The following actions are taken by the patch.

At XA-prepare:
  when empty binlog cache - don't do anything to binlog if RO,
  otherwise write empty XA_prepare (assert(binlog-filter case)).
At Disconnect:
  when Prepared &amp;&amp; RO (=&gt; no binlogging was done)
    set Xid_cache_element::error := ER_XA_RBROLLBACK
    *keep* XID in the cache, and rollback the transaction.
At XA-"complete":
   Discover the error, if any don't binlog the "complete", return the error to the user.

RO patch review notes.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
(Pushed to 10.5)
Are addressed along the following policies.
Prepared read-only, or on non-transactional engines, or
binlog-* filter in binlog, or skipped to binlog XA:s remains in the xid cache after disconnect.
But their consequent completion with Commit or Rollback differs.

1. The read-only at reconnect marks XID to fail for future
completion with ER_XA_RBROLLBACK.

2. `binlog-*` filtered XA when it changes engine data is regarded
as loggable even when nothing got cached for binlog.
An empty XA-prepare group is recorded. Consequent Commit-or-Rollback
succeeds in the Engine(s) as well as recorded into binlog.

3. The same applies to the non-transactional engine XA.

4. @@skip_log_bin=OFF does not record anything at XA-prepare (obviously),
but the completion event is recorded into binlog to admit
inconsistency with slave.

The following actions are taken by the patch.

At XA-prepare:
  when empty binlog cache - don't do anything to binlog if RO,
  otherwise write empty XA_prepare (assert(binlog-filter case)).
At Disconnect:
  when Prepared &amp;&amp; RO (=&gt; no binlogging was done)
    set Xid_cache_element::error := ER_XA_RBROLLBACK
    *keep* XID in the cache, and rollback the transaction.
At XA-"complete":
   Discover the error, if any don't binlog the "complete", return the error to the user.

RO patch review notes.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-742 XA PREPAREd transaction survive disconnect/server restart</title>
<updated>2020-03-14T19:48:02+00:00</updated>
<author>
<name>Andrei Elkin</name>
<email>andrei.elkin@mariadb.com</email>
</author>
<published>2019-03-30T21:47:28+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=a467e6755dc28159ee0bef42bea35cffb9b7bacb'/>
<id>a467e6755dc28159ee0bef42bea35cffb9b7bacb</id>
<content type='text'>
Lifted long standing limitation to the XA of rolling it back at the
transaction's
connection close even if the XA is prepared.

Prepared XA-transaction is made to sustain connection close or server
restart.
The patch consists of

    - binary logging extension to write prepared XA part of
      transaction signified with
      its XID in a new XA_prepare_log_event. The concusion part -
      with Commit or Rollback decision - is logged separately as
      Query_log_event.
      That is in the binlog the XA consists of two separate group of
      events.

      That makes the whole XA possibly interweaving in binlog with
      other XA:s or regular transaction but with no harm to
      replication and data consistency.

      Gtid_log_event receives two more flags to identify which of the
      two XA phases of the transaction it represents. With either flag
      set also XID info is added to the event.

      When binlog is ON on the server XID::formatID is
      constrained to 4 bytes.

    - engines are made aware of the server policy to keep up user
      prepared XA:s so they (Innodb, rocksdb) don't roll them back
      anymore at their disconnect methods.

    - slave applier is refined to cope with two phase logged XA:s
      including parallel modes of execution.

This patch does not address crash-safe logging of the new events which
is being addressed by MDEV-21469.

Many thanks to Alexey Botchkov for driving this work initially!

*Aux Intenal: Bugs found and their fixes during review and QA:
--------------------------------------------------------------
Removed from 25fe744e5c3 Xid_cache_element::binlogged and associated
  logics. The change has made few tests to fail due to
  unexpected XID not found error and such.
  It's fixed by a next commit that handles all corner cases dealing
  with empty binlog cache due to ("myisam" xa, binlog-filter,
  zero-effect-to-binlog DML incl pure "ro" like SELECT)

Removed a test file whose logics is repeated by MDEV-21469;
  cleanup up xid_cache_insert();
Review notes on 754cf0d5ff are addressed;
MDEV-21644 Assertion thd-&gt;transaction.xid_state.is_explicit_XA() in  binlog_commit_flush_trx_cache

  The reason for assert was unexpected combinaton of inefficient
  update on trx engine and ONE phase commit. It is refined. A test is
  added that also revealed a missed piece of cleanup for engine
  prepared transaction object. Exra reset is conveyed:
  trx-&gt;mysql_log_file_name = 0.

cleanup rpl_parallel xid cache

MDEV-742 post-svoj cleanup

post-rebase test results fixed.

Rocksdb+Innodb xa transaction tests are added.

MDEV-742: affected tests and bb failure induced in binlog suit test.

MDEV-742: cleanup in the main part also to adapt to Extended debug_sync_control life time
commit.

MDEV-742 rebased, edit commit to merge into 742.

MDEV-742: cleanup - memcpy and spaces.

MDEV-742 cleanup: redundant term in if and corrected comments.

MDEV-742 (main patch cleanup).
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Lifted long standing limitation to the XA of rolling it back at the
transaction's
connection close even if the XA is prepared.

Prepared XA-transaction is made to sustain connection close or server
restart.
The patch consists of

    - binary logging extension to write prepared XA part of
      transaction signified with
      its XID in a new XA_prepare_log_event. The concusion part -
      with Commit or Rollback decision - is logged separately as
      Query_log_event.
      That is in the binlog the XA consists of two separate group of
      events.

      That makes the whole XA possibly interweaving in binlog with
      other XA:s or regular transaction but with no harm to
      replication and data consistency.

      Gtid_log_event receives two more flags to identify which of the
      two XA phases of the transaction it represents. With either flag
      set also XID info is added to the event.

      When binlog is ON on the server XID::formatID is
      constrained to 4 bytes.

    - engines are made aware of the server policy to keep up user
      prepared XA:s so they (Innodb, rocksdb) don't roll them back
      anymore at their disconnect methods.

    - slave applier is refined to cope with two phase logged XA:s
      including parallel modes of execution.

This patch does not address crash-safe logging of the new events which
is being addressed by MDEV-21469.

Many thanks to Alexey Botchkov for driving this work initially!

*Aux Intenal: Bugs found and their fixes during review and QA:
--------------------------------------------------------------
Removed from 25fe744e5c3 Xid_cache_element::binlogged and associated
  logics. The change has made few tests to fail due to
  unexpected XID not found error and such.
  It's fixed by a next commit that handles all corner cases dealing
  with empty binlog cache due to ("myisam" xa, binlog-filter,
  zero-effect-to-binlog DML incl pure "ro" like SELECT)

Removed a test file whose logics is repeated by MDEV-21469;
  cleanup up xid_cache_insert();
Review notes on 754cf0d5ff are addressed;
MDEV-21644 Assertion thd-&gt;transaction.xid_state.is_explicit_XA() in  binlog_commit_flush_trx_cache

  The reason for assert was unexpected combinaton of inefficient
  update on trx engine and ONE phase commit. It is refined. A test is
  added that also revealed a missed piece of cleanup for engine
  prepared transaction object. Exra reset is conveyed:
  trx-&gt;mysql_log_file_name = 0.

cleanup rpl_parallel xid cache

MDEV-742 post-svoj cleanup

post-rebase test results fixed.

Rocksdb+Innodb xa transaction tests are added.

MDEV-742: affected tests and bb failure induced in binlog suit test.

MDEV-742: cleanup in the main part also to adapt to Extended debug_sync_control life time
commit.

MDEV-742 rebased, edit commit to merge into 742.

MDEV-742: cleanup - memcpy and spaces.

MDEV-742 cleanup: redundant term in if and corrected comments.

MDEV-742 (main patch cleanup).
</pre>
</div>
</content>
</entry>
<entry>
<title>Pre-MDEV-742 InnoDB fixes</title>
<updated>2020-03-13T11:44:42+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2020-03-12T12:34:44+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=78cc9c9ebfd689261e3f9ff91fd422778f658bbe'/>
<id>78cc9c9ebfd689261e3f9ff91fd422778f658bbe</id>
<content type='text'>
1. Refactored innobase_close_connection(). Transaction must've already
been rolled back by this time. We should expect only transactions in the
PREPARED state when MDEV-742 is done.

2. Added missing put_pins() to trx_disconnect_prepared(). Missing
put_pins() wasn't a problem because trx_disconnect_prepared() is a dead
code. But it will get revived in the main MDEV-742 patch.

3. Fixed missing reset of trx-&gt;mysql_log_file_name when RW transaction
didn't emit any log records (zero-modification RW). The problem was
detected by ASAN when disconnected XA transaction was trying to make
use of inherited mysql_log_file_name pointing into binlog data of
detached THD.

This missing reset also had user-visible side effect, when
trx_sys_print_mysql_binlog_offset() would report binlog position
not of the most recently committed transaction.

One of possible scenarios that is expected to misbehave is as following:

  thr1&gt; CREATE TABLE t1(a INT) ENGINE=InnoDB;
  thr1&gt; INSERT INTO t1 VALUES(1);
  thr1&gt; BEGIN;
  thr1&gt; UPDATE t1 SET a=1
  thr1&gt; COMMIT; -- zero-modification, misses to reset mysql_log_file_name

  thr2&gt; BEGIN;
  thr2&gt; INSERT INTO t1 VALUES(2);
  thr2&gt; COMMIT;

  thr1&gt; BEGIN;
  thr1&gt; do-some-real-changes;
  thr1&gt; ROLLBACK; -- will store binlog pos from previous COMMIT in thr1?

In this case it means if binlog is replayed from position reported by
trx_sys_print_mysql_binlog_offset(), t1 will end up with two records
containing '2'.

Part of
MDEV-742 - XA PREPAREd transaction survive disconnect/server restart
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
1. Refactored innobase_close_connection(). Transaction must've already
been rolled back by this time. We should expect only transactions in the
PREPARED state when MDEV-742 is done.

2. Added missing put_pins() to trx_disconnect_prepared(). Missing
put_pins() wasn't a problem because trx_disconnect_prepared() is a dead
code. But it will get revived in the main MDEV-742 patch.

3. Fixed missing reset of trx-&gt;mysql_log_file_name when RW transaction
didn't emit any log records (zero-modification RW). The problem was
detected by ASAN when disconnected XA transaction was trying to make
use of inherited mysql_log_file_name pointing into binlog data of
detached THD.

This missing reset also had user-visible side effect, when
trx_sys_print_mysql_binlog_offset() would report binlog position
not of the most recently committed transaction.

One of possible scenarios that is expected to misbehave is as following:

  thr1&gt; CREATE TABLE t1(a INT) ENGINE=InnoDB;
  thr1&gt; INSERT INTO t1 VALUES(1);
  thr1&gt; BEGIN;
  thr1&gt; UPDATE t1 SET a=1
  thr1&gt; COMMIT; -- zero-modification, misses to reset mysql_log_file_name

  thr2&gt; BEGIN;
  thr2&gt; INSERT INTO t1 VALUES(2);
  thr2&gt; COMMIT;

  thr1&gt; BEGIN;
  thr1&gt; do-some-real-changes;
  thr1&gt; ROLLBACK; -- will store binlog pos from previous COMMIT in thr1?

In this case it means if binlog is replayed from position reported by
trx_sys_print_mysql_binlog_offset(), t1 will end up with two records
containing '2'.

Part of
MDEV-742 - XA PREPAREd transaction survive disconnect/server restart
</pre>
</div>
</content>
</entry>
<entry>
<title>Extended debug_sync_control life time</title>
<updated>2020-03-13T11:44:42+00:00</updated>
<author>
<name>Sergey Vojtovich</name>
<email>svoj@mariadb.org</email>
</author>
<published>2020-03-10T13:43:42+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=662d8a8638569c196a20e912fd8a8ab97e364a00'/>
<id>662d8a8638569c196a20e912fd8a8ab97e364a00</id>
<content type='text'>
It now lives from THD constructor to THD destructor. Reset before THD is
released to a cache. Change user doesn't reset debug_sync_control anymore.

Needed to be able to make use of DEBUG_SYNC() at later stages like
ha_close_connection().
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It now lives from THD constructor to THD destructor. Reset before THD is
released to a cache. Change user doesn't reset debug_sync_control anymore.

Needed to be able to make use of DEBUG_SYNC() at later stages like
ha_close_connection().
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-21903 FTS optimize thread aborts during shutdown</title>
<updated>2020-03-13T08:22:07+00:00</updated>
<author>
<name>Thirunarayanan Balathandayuthapani</name>
<email>thiru@mariadb.com</email>
</author>
<published>2020-03-12T17:54:47+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=c58686447ff7eac2f480e8539da4f551ae0609ef'/>
<id>c58686447ff7eac2f480e8539da4f551ae0609ef</id>
<content type='text'>
- This issue was caused by 5e62b6a5e06eb02cbde1e34e95e26f42d87fce02.
fts_optimize_callback() should free fts_optimize_wq and make it as NULL
when it receives FTS_MSG_STOP message. So that subsequent
fts_optimize_callback() doesn't fail with segmentation fault.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- This issue was caused by 5e62b6a5e06eb02cbde1e34e95e26f42d87fce02.
fts_optimize_callback() should free fts_optimize_wq and make it as NULL
when it receives FTS_MSG_STOP message. So that subsequent
fts_optimize_callback() doesn't fail with segmentation fault.
</pre>
</div>
</content>
</entry>
<entry>
<title>Update libmariadb to fix GCC -Wstringop-truncation</title>
<updated>2020-03-13T08:12:32+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2020-03-13T08:12:32+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=e74c1c9ece7728800f1c5111325ffd54ba815fbc'/>
<id>e74c1c9ece7728800f1c5111325ffd54ba815fbc</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-15058: Remove buf_pool_get_dirty_pages_count()</title>
<updated>2020-03-13T08:09:15+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2020-03-13T08:09:15+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=fbe662a5035696fe7ebb1353c6793091634c1867'/>
<id>fbe662a5035696fe7ebb1353c6793091634c1867</id>
<content type='text'>
Starting with commit 1a6f708ec594ac0ae2dd30db926ab07b100fa24b
the function buf_pool_get_dirty_pages_count() is only used
in a debug check. It was dead code for non-debug builds.

buf_flush_dirty_pages(): Perform the debug check inline,
and replace the assertion
	ut_ad(first || buf_pool_get_dirty_pages_count(id) == 0);
with another one that is executed while holding the mutexes:
	ut_ad(id != bpage-&gt;id.space());
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Starting with commit 1a6f708ec594ac0ae2dd30db926ab07b100fa24b
the function buf_pool_get_dirty_pages_count() is only used
in a debug check. It was dead code for non-debug builds.

buf_flush_dirty_pages(): Perform the debug check inline,
and replace the assertion
	ut_ad(first || buf_pool_get_dirty_pages_count(id) == 0);
with another one that is executed while holding the mutexes:
	ut_ad(id != bpage-&gt;id.space());
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-21920 binlog_encryption.rpl_gtid_basic test failure with --ps</title>
<updated>2020-03-13T05:09:21+00:00</updated>
<author>
<name>Alexander Barkov</name>
<email>bar@mariadb.com</email>
</author>
<published>2020-03-13T05:07:51+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=2bbcf9a19ccefb93ebe319af2c8e06207cbfe6dd'/>
<id>2bbcf9a19ccefb93ebe319af2c8e06207cbfe6dd</id>
<content type='text'>
Updating libmariadb to use 3be5897c3346639fa6d7195480d93108798c4917,
which fixed the problem.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Updating libmariadb to use 3be5897c3346639fa6d7195480d93108798c4917,
which fixed the problem.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-20632: Fix -Wmaybe-uninitialized</title>
<updated>2020-03-13T04:59:34+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2020-03-13T04:59:34+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=f48718be4ec01012628c0deb0c22abbca8a708d5'/>
<id>f48718be4ec01012628c0deb0c22abbca8a708d5</id>
<content type='text'>
Create_tmp_table::add_fields(): Initialize uneven_delta= 0
to suppress the warning from GCC 9.2.1 and 10.0.1,
and consistently indent the code with spaces.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Create_tmp_table::add_fields(): Initialize uneven_delta= 0
to suppress the warning from GCC 9.2.1 and 10.0.1,
and consistently indent the code with spaces.
</pre>
</div>
</content>
</entry>
<entry>
<title>MDEV-21907: Fix or disable -Wconversion on GCC 5.3.0 i386</title>
<updated>2020-03-13T04:55:00+00:00</updated>
<author>
<name>Marko Mäkelä</name>
<email>marko.makela@mariadb.com</email>
</author>
<published>2020-03-13T04:55:00+00:00</published>
<link rel='alternate' type='text/html' href='http://trove.baserock.org/cgit/delta/mariadb-git.git/commit/?id=c57b207958264d18cfe0a7811a74fbb271245124'/>
<id>c57b207958264d18cfe0a7811a74fbb271245124</id>
<content type='text'>
Fix or disable those -Wconversion that were missed by GCC 5.4.0
targeting AMD64.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix or disable those -Wconversion that were missed by GCC 5.4.0
targeting AMD64.
</pre>
</div>
</content>
</entry>
</feed>
