Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RM-1427 PXC-8.0.37-29 #1955

Merged
merged 472 commits into from
Sep 19, 2024
Merged

RM-1427 PXC-8.0.37-29 #1955

merged 472 commits into from
Sep 19, 2024

Conversation

adivinho
Copy link
Contributor

No description provided.

Tor Didriksen and others added 30 commits February 12, 2024 16:43
Remove all old source files.

Change-Id: Ic6b344e51849b9e1cfcde823b51ff0672c4e888c
(cherry picked from commit 04b656eb2bcbdc4c43bdb9d3fd48c73d35537051)
TestDIM is a singleton class used in Router tests.
As a singleton it wants to delete the copy operator=
but there is a typo there and it deletes operator== instead.

This patch fixes this typo.

Change-Id: I07802fb23b792148877f794586024d18a1afd099
Some Router code uses inconsistent way of determining windows
architecture, using WIN32 define instead of _WIN32.

This patch replaces use of WIN32 with _WIN32.

Change-Id: If631ff6f13877dfab327bbb6ba71db4c45458a12
ASAN reported a use-after-free when a Channel is std::move()d in
async_recv().

1. the move() .cancel()s all async-operations
2. the async operation MUST not touch anything if it is canceled.

async_recv() calls view_sync_raw() on a destructed part of the
moved-channel.

Change
======

- only sync the view on success of the async operation.

Change-Id: I82d9ea666c4db5a8962d4f63ac1cbc3884974d4e
MEMEORY LEAK INhigher versions and thus
NDB_SHARE::SET_BINLOG_FLAGS_FOR_TABLE FAILS TEST IN PB2
Bug#30548488
MTR TEST CASE NDB_DIST_PRIV FAILS DUE TO MEMORY LEAK IN PB2
Bug#30548527
MTR TEST CASE NDB_MULTI FAILS DUE TO MEMORY LEAK IN PB2
Bug#35912724
Test ndb.ndb_multi_mgmd fail on PB2 gcov
Bug#30548511
MTR TEST CASE NDB_STARTUP FAILS DUE TO MEMORY LEAK IN PB2

Problem:
1. Buffer for bitmap describing which rows stored is not always
released.
2. Unpacked frm data not released when failing to open NDB table

Solution:
1. Instead of dynamically allocating buffer as part of initializing
bitmap, provide a buffer with same lifetime as the actual bitmap. Thus
there is no need to release the bitmap.
2. relase frm data when failing to open NDB table

These problem has been properly solved in higher versions.

Change-Id: I2b6f7ac6c8d28dbc702ca534ecaf71f46395d007
0" ON SHUTDOWN

Note: This commit backports the bug fix to 8.0

Background:
-----------
  If the pseudo_replica_mode is enabled and an internal binlog command
is run, the current thread is treated as an applier thread. If an XA
START query is issued at this stage, the applier thread will detach the
native transaction thread from all handlertons and store the backup in
hton->slot's ha_ptr_backup via rpl_detach_engine_ha_data. The detached
transaction is returned back during a commit or rollback via
rpl_reattach_engine_ha_data.

Issue:
------
  If a shutdown is issued in the same session which is marked as an
applier, immediately after an XA START, then the call to reattach via
rpl_reattach_engine_ha_data is missed. The shutdown is handled in
ha_rollback_low. Since no statements were run after the XA START,
ha_list is empty, skipping over the checks to reattach the engine data.
As the shutdown progresses, innodb asserts that the
trx_sys->mysql_trx_list (list of trx_t's created for mysql) is not empty
during trx_sys_close().
  A similar issue is seen in ha_commit_low. If ha_list is empty,
thd->rpl_reattach_engine_ha_data will be skipped. If a new XA START is
issued at this stage, then an assert is hit stating that ha_engine_data
is already detached

Fix:
----
  Ensure that the checks to reattach engine ha data happens even if
ha_list is empty in both ha_commit_low and ha_rollback_low

Change-Id: I7124c8e45157a15965e0e91d171a822f6d066072
Series

Description:
  This worklog relaxes clone version constraints and allows cloning in
certain special cases when donor and recipient versions differ. Cloning
is allowed if the version strings match. For 8.1+ version series,
cloning is allowed if major and minor versions match. For 8.0 version
series, cloning is not allowed if either donor or recipient's patch
version is less than backport version (the version in which this worklog
is backported) and they mismatch. For 8.0 version series, if both patch
versions are above backport, then cloning is allowed if major and minor
versions match.

Change-Id: Ife21d4ab9d81434e296c5e856e56c75cc67f486e
A compiler warning in jtie_tconv_array_impl, "variable 's' set
but not used", revealed a bug in the template code.

The existing return statement caused C *c to be implicitly
cast to a cstatus and then returned. Return s, as documented.

Note that two functions ObjectArrayConvImpl::copyToCObjectArray()
and ObjectArrayConvImpl::copyToJavaObjectArray(), affected by this
change, are actually unused. Martin Zaun noted this in his comment
at line 280: "while assumed to work, this mapping has not been used
and tested yet."

Change-Id: Ib1a4a3cb28bfac9f3ea0506b2da036e3c642ec6b
Enable static_asserts that were disabled pending C++11 support.

Define "template<class> constexpr bool missing_..." to ensure that
evaluation of the static_assert is deferred until templates are
instantiated.

Remove the lines "(void)env" (etc.) that were used to prevent
unused parameter warnings. If this code is ever evaluated at all,
the static_asserts will fire.

Change-Id: I16d73b665b3178bc7afd6e6d92f6579498d6fd43
This bug report notes that ndb_restore behaves incorrectly when both
the --disable-indexes and --include-stored-grants options are supplied.

The fix is implemented by removing the existing code to handle the
--include-stored-grants option, and replacing it with an implementation
that exactly matches that of --with-apply-status.

A comprehensive new MTR test, backup_stored_grants, is added to
suite ndb.

Change-Id: I293ef2d32ce0e5a81a82b4792ffc62ae9558a1c8
…y guarantees

When group_replication_consistency is set to BEFORE_ON_PRIMARY_FAILOVER, new RO
or RW transactions with a newly elected primary that is applying backlog from
the old primary are held (not applied) until any backlog has been applied.

Although all writes are held when using BEFORE_ON_PRIMARY_FAILOVER consistency
level, not all reads are blocked to ensure that you can still inspect the
server while it is applying backlog after a promotion took place.
This is useful for debugging, monitoring, observability and troubleshooting.

KILL is an important such statement and should be allowed when using
BEFORE_ON_PRIMARY_FAILOVER consistency.
This patch allows the KILL statement to execute when using
BEFORE_ON_PRIMARY_FAILOVER consistency mode.

Change-Id: I4618f72a5da6690ddd3606654238a310c88bddf3
Problem: SET offline_mode=on could hang and make system unresponsive
Root cause: With many connections SET offline_mode could end up writing
so much to the TP notify descriptor that send() would block. If this
happens when the TP waiting_thread is waiting for a mutex held by SET
offline_mode a deadlock would result.

Solution: Add a flag which is set when the notify descriptor is written
to, and cleared by the waiting thread when it drains (reads all
available bytes) the notify descriptor. As long as the flag is set new
kill notifcations do not actually write to the notify descriptor. That
way the capacity of the notify descriptor is not exceeded.
Additional writes before the notify descriptor has been drained are
redundant since the waiting_thread iterates over
all connections in the thread group to identify those that are killed.

Increase the number of connections allowed by mysqltest, to be able to
create the required number of connections.

Fix an off-by-one error which prevented admin group connections from
being displayed in in P_S.tp_connections.

Change-Id: Ib6d6c7748a6a14bf6051b4c1d8152ee04e1e16ec
…ST. =="

This reverts commit 8d28305a55df37fab6e8b6485263a7cfae00c959.

Note: This commit reverts the bug fix in 8.0

Changes in ha_commit_low causes failure in
binlog.binlog_xa_trx_split_across_binlog 'row' when MTR is run with
--mysqld=--enforce-gtid-consistency --mysqld=--gtid-mode=on

Change-Id: I58734f428fb16696be5b6f5cb2557007c1bee827
…fer, noclose]

Reduce the number of files that use the robin-hood-hashing library, so
that there are fewer places to modify when replacing it with the new
library.

This patch moves the definition of the hash map used by
HashJoinRowBuffer from hash_join_buffer.h to hash_join_buffer.cc, so
that there is no reference to robin_hood.h from the header file. This
reduced the number of files that depend on robin_hood.h directly or
indirectly.

Change-Id: I9544b8fac9747dd53883f229ac9bb456f4a52900
(cherry picked from commit ad0ac49b1827033cf2086b9b43d506a67315b92a)
Remove the robin-hood-hashing library and replace it with
ankerl::unordered_dense version 4.4.0 from
https://github.com/martinus/unordered_dense.

It was more or less a drop-in replacement. What needed some adjustment
was that the new library didn't have the same helper function for
estimating the memory used by the hash map. Manually calculated the
size of the bucket vector and the value vector instead.

Change-Id: I24745ab716be3c8607c877b24773cc7c30970402
(cherry picked from commit 8bf89a6bb2d88e1b474ba324243c429ab3646f46)
Symptoms
----------
The SELECT COUNT(*) query that uses secondary index for scan, takes more
than 6X with 8.0 compared to 5.7. Performance of the query that use the
clustered index for scan is at par with 5.7.

Background
----------
In 8.0.14, we introduced parallel scan of subtrees of a clustered index
through 'WL#11720 InnoDB: Parallel read of index'. This feature was
further improved through 'WL#12978 InnoDB:Fix imbalance during parallel
scan' in 8.0.17.
The idea of the second worklog was to utilize the parallel read threads
which were introduced through first worklog.
Second worklog also made another intentional change(not documented!)
that is, secondary index scan in InnoDB started using the parallel scan
of clustered index. In other words, even if Optimizer hints InnoDB to
use secondary index for scan, InnoDB ignores that, and uses clustered
index for scan. This observation was reported in the following bugs:

'Bug#31791868 INDEX HINT DOES NOT AFFECT COUNT(*) EXECUTION'
'Bug#35981123 SELECT COUNT is slow with O_DIRECT'

The second worklog enabled the clustered index (parallel) scan even for
secondary index scan for the following two reasons :
- Post WL#12978, performance of clustered index scan was much improved.
- Cost of scanning the secondary index is much higher to support the
  MVCC semantics i.e. read-committed, repeatable-read isolation levels.
  That is because before reporting a record from a secondary index,
  InnoDB must ensure it is visible to the query's read-view. That might
  require a dive into clustered index to consult corresponding row's
  undo chain. This can be avoided in case InnoDB sees that a secondary
  index record was not modified since read-view's creation, but
  unfortunately this information is not available per-row, only
  per-page. So, if any of the records on the page was modified since
  read-view's creation, the heuristic will not help, and dives to
  clustered index will be needed for all records from this secondary
  index page.

The second reason is main argument behind this change which can be
easily reproduced by modifying a few records in the table and then
executing the query in a session that has read_view created before
the modification, for example by having opened transaction on
isolation level of Repeatable Read before the modifications.
In my experiment, I found with secondary index scan(or with this fix),
query performed 30X worse than the query performed without a read view.

Thus it is really a trade off between using the clustered scan that is
better in worst case vs using the secondary index as Optimizer hints
which is better in most of the cases.

Fix
----
- Do not break the contract with Optimizer(Bug#31791868). User now
  (again) has an option to provide index hint to the query, to force
  using clustered index.

- We must improve Optimizer's heuristic so that it can hints the
  correct index to use. Created 'Bug#36297856 Query performance
  dropped by 30X with secondary index scan due to MVCC checks',
  for Optimizer team to improve the heuristic in Optimizer.

- Reverted part of the WL#12978 changes that forced clustered index
  (parallel) scan for secondary index scan.

Change-Id: Icb081d076cb6875e7b973e68ff6cfcce8ae3f82a
…ons [8.0]

Post WL#15989: Innodb: Allow clone across patch releases within one LTS Series
clone is allowed between LTS patch version.
At present Group Replication blocks cloning between cross version
members.
However GR should allow clone from any version.
And Clone plugin can decide if clone can be done or not between
cross-version members.

Change-Id: Ib06a54487fa0b76c3df95babd0ce2c031859f6cb
…t_ngram

PS-9048 fix 5.7: Fixed problem with percent character in n-grams
Split router/cmake/configure.cmake to allow reuse.

Change-Id: I4f4ca13729767e14ff75d0d915b124596ed1e132
https://perconadev.atlassian.net/browse/PS-9096

Raised MYSQL_VERSION_EXTRA to 49 in MYSQL_VERSION file.
Raised PERCONA_INNODB_VERSION to 49 in univ.i file.
               index scan

Description:
- Indexes are ordered based on their keys. Loose
  index scan effectively jumps from one unique value
  (or set of values) to the next based on the index’s prefix
  keys.

- To “jump” values in an index, we use the handler
  call: ha_index_read_map().

- the first range read sets an end-of-range
  value to indicate the end of the first range.

- The next range read does not clear the previous end-of-range value
  and applies it to the current range.

- Since the end-of-range value has already been crossed in the
  previous range read, this causes the reads to stop. So the
  iteration is finished with the current range without moving
  onto the next range(unique set of values)resulting in an
  incorrect query result.

Fix:
- In order to find the next unique value, the old end-of-range
  value is cleared.

Change-Id: I84290fb794db13ec6f0795dd14a92cf85b9dad09
Problem: mysqldump not sanitizing the version string obtained from
server which may lead to injecting malicious commands to the output.

Fix: added function sanitizing the version string by cutting off
illegal part and issuing warning.

Test: check the server version in the output with and without injected
payload.

Change-Id: I1f19e1c90bdb8d444285e427092face3bb16da01
In jtie_gcalls.hpp, macros are used to create lists and templates.
Many of these could stringify or concatenate up to 20 parameters,
but capacity beyond about 13 is not needed.

This patch shortens the lists. Clang will sometimes print a
"rejecting template" error for each candidate template not chosen,
so this helps to reduce the number of error messages generated
before the compiler finally gives up.

Change-Id: Iddbb25d0a6e5740815b686259c734a0bbf434d8d
An earlier version of jtie_gcalls generated two distinct templates
for gcall_mfv() and gcall_mfr() to map the const and non-const
variants of otherwise identical method calls.

This strategy was abandoned because some very old C++ compilers could
not handle the macro invocations that were used, and because
Microsoft's compilers considered the two templates to be equivalent.

Microsoft compilers still behave the same way, but Clang requires
distinct templates. This patch restores the earlier design, but
only in non-Microsoft environments.

Change-Id: I6694c7cdc096a6675e71bcd843fec99421367c70
In jtie_tconv_object_impl.hpp, add a missing specialization
of Target<J, C> for const C.

Fix an incorrect mapping in myjapi_classes.hpp for
C0::check().

Then undefine JTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION, and
compile and run the tests (use "ctest -R jtie").

Change-Id: I5911bb6ef9ea149c2242378d39956a4d4afaab84
The jtie mapping for NdbOperation::getNdbErrorLine() should be marked
as const-overloaded.

The jtie mapping for Ndb_cluster_connection::set_service_uri() was
declared as void, but should actually return int.

The mappings for three const methods were defined to use the _t
variant of the object trait type, but need to use the _ct variant.

Change-Id: I4ab9e7a093c74edef72e2141d701e2e6c32b8bb6
In ndbjtie_defs.hpp, remove the "XXXXX temporary, for testing" comment
from 2011, and do not define NDBJTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION
or NDBJTIE_USE_WRAPPED_VARIANT_FOR_OVERLOADED_FUNCTION.

This will enable use of the unwrapped mappings for most of the NDB API
on all platforms.

Change-Id: Id132500995cbaee62e7c1e5aa40f9272613501bb
Remove most JTie wrappers. They are no longer needed.
The only remaining method wrappers are a small set for
overloaded methods that have both const and non-const
versions.

Use "unifdef -UNDBJTIE_USE_WRAPPED_VARIANT_FOR_FUNCTION" and
"unifdef -UNDBJTIE_USE_WRAPPED_VARIANT_FOR_OVERLOADED_FUNCTION"
to remove wrapped variants from the ndbapi and mysql_utils jtie
header files.

Change-Id: Ie08c2242aed2bfda02defe76fef40bd0bad6e9e7
adivinho and others added 24 commits July 19, 2024 16:41
PS-9320 Please add tarballs for Debian bookworm and Ubuntu Noble for PS
PS-9284 Release tasks ticket for PS-8.0.37
Merge tag 'Percona-Server-8.0.37-29' into 8.0

***
Changes in the `build-ps` directories were ignored and the PXC version
of them were restored.

***
man/ndb* files were not merged.

***
Actual conflicts:
        README.md
        packaging/rpm-docker/mysql.spec.in
        sql/srv_session.cc
        storage/innobase/handler/ha_innodb.cc
        storage/innobase/os/os0file.cc

Conflicts:
	README.md
	build-ps/build-binary.sh
	build-ps/debian/control
	build-ps/debian/percona-server-server.install
	build-ps/debian/percona-xtradb-cluster-server.postinst
	build-ps/debian/percona-xtradb-cluster-server.postrm
	build-ps/debian/rules
	build-ps/percona-server-8.0_builder.sh
	build-ps/percona-server.spec
	man/ndb_blob_tool.1
	man/ndb_config.1
	man/ndb_delete_all.1
	man/ndb_desc.1
	man/ndb_drop_index.1
	man/ndb_drop_table.1
	man/ndb_error_reporter.1
	man/ndb_import.1
	man/ndb_index_stat.1
	man/ndb_mgm.1
	man/ndb_mgmd.8
	man/ndb_move_data.1
	man/ndb_perror.1
	man/ndb_print_backup_file.1
	man/ndb_print_file.1
	man/ndb_print_frag_file.1
	man/ndb_print_schema_file.1
	man/ndb_print_sys_file.1
	man/ndb_redo_log_reader.1
	man/ndb_restore.1
	man/ndb_secretsfile_reader.1
	man/ndb_select_all.1
	man/ndb_select_count.1
	man/ndb_show_tables.1
	man/ndb_size.pl.1
	man/ndb_top.1
	man/ndb_waiter.1
	man/ndbd.8
	man/ndbinfo_select_all.1
	man/ndbmtd.8
	man/ndbxfrm.1
	packaging/rpm-docker/mysql.spec.in
	sql/srv_session.cc
	storage/innobase/handler/ha_innodb.cc
	storage/innobase/os/os0file.cc
https://perconadev.atlassian.net/browse/PXC-4407

***
Fixed the debug sync timeout failure for galera_alter_table_mdl test.

***
Fixed other MTR failures
https://perconadev.atlassian.net/browse/PXC-4407

Description
-----------
Server compilation fails with gcc-13 due to nonnull-compare of `this`
pointer in the WSREP(THD) macro.

  sql/binlog.cc: In member function ‘int THD::decide_logging_format(Table_ref*)’:
  sql/binlog.cc:10730:47: error: ‘nonnull’ argument ‘this’ compared to NULL [-Werror=nonnull-compare]

We get this error when `this` pointer is compared with NULL when
Werror=nonnull-compare is specified.

Solution
--------
Occurences of `WSREP(this)` have been replaced with `WSREP_NNULL(this)`.
https://perconadev.atlassian.net/browse/PXC-4436

Implemented PXC-specific adjustments to percona_telemetry component.

1. Default target path
2. gcache/writeset cache encryption info
3. PXC cluster replication info

(cherry picked from commit 8259b8e)
https://perconadev.atlassian.net/browse/PXC-4407

***
As a follow-up to the bugfix
(PS-8963 fix: SEQUENCE_TABLE Issue)
commit (1020604), occurences of 'SEQUENCE_TABLE()' in MTR tests were
replaced with the new 'PERCONA_SEQUENCE_TABLE()'.
https://perconadev.atlassian.net/browse/PXC-4407

***
Follow-up fixes to galera-4.20 merge

***
Update submodule pointers
PXC-4407: PXC 8.0.37 refresh - Q2 2024
PXC-4407: PXC 8.0.37 refresh - Q2 2024 (Fix compilation failure with
PXC-4482 Release and packaging tasks for PXC-8.0.37
PXC-3820 Broken AppArmor profile after upgrade
PXC-4407: PXC 8.0.37 refresh - Q2 2024 (update submodule pointer)
@it-percona-cla
Copy link

it-percona-cla commented Sep 18, 2024

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you all sign our Contributor License Agreement before we can accept your contribution.
5 out of 6 committers have signed the CLA.

✅ VarunNagaraju
✅ surbhat1595
✅ adivinho
✅ venkatesh-prasad-v
✅ kamil-holubicki
❌ percona-ysorokin
You have signed the CLA already but the status is still pending? Let us recheck it.

@adivinho adivinho requested review from a team and kamil-holubicki September 18, 2024 11:29
@venkatesh-prasad-v venkatesh-prasad-v merged commit 9a4609a into 8.0 Sep 19, 2024
9 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.