Conversation
Post-push fix for a test failure when running mtr with --hypergraph. An assertion failure is seen with the hypergraph optimizer because a TABLE_VALUE_CONSTRUCTOR access path has uninitialized init_cost. Fixed by initializing the init_cost. Also filter out some result differences between the old optimizer and the hypergraph optimizer. Change-Id: Ia62344abeba625ff2026554e5ef2ac57113dce0e
…b-page-size=4k Fixing a pb2 failure by running test only for 16k innodb page size. approved by Kuba Lopuszanski <jakub.lopuszanski@oracle.com> over IM.
Description:
------------
SET PERSIST does not make sense for gtid_purged variable.
Unfortunately, SET PERSIST is allowed. After a SET PERSIST statement
has been executed, the variable stops working as expected, and takes
only the value specified in the last SET PERSIST or SET PERSIST_ONLY
statement. It does not represent the state derived from the binary
log and mysql.gtid_executed table.
This has many bad consequences:
- The next time the server attempts to restart, the server will to
fail to restart (unless the persisted value is a superset of the
real value).
- There are decisions made based on @@global.gtid_purged. Internal
checks in the server are based on the correct values, not shadowed
by the persisted value. But checks in e.g. MySQL Shell are based on
values retrieved through the SQL interface, in which the correct
value is shadowed by the persisted value. Therefore, Shell may
report errant transactions when there are none, or fail to report
existing errant transactions. It may report that a replica has been
left behind (not received transactions which the source has already
purged), even if it has not, or it may fail to report that a replica
has been left behind even if it has. If we take a freshly
initialized data directory from a MySQL 5.7 instance and upgrade
it to 8.0, the definition gtid_executed differs from the definition
of the same tables, in a freshly initialized datadir of an 8.0
instance.
Analysis:
------------
gtid_purged is a variable that tracks server state. Its value is
always preserved through server restarts because its value is derived
from binary log files and the mysql.gtid_executed table
(and SET @@global.gtid_purged maintains this property because it
updates mysql.gtid_executed).
Fix:
----
Made gtid_purged variable as non-persistant.
Reviewed by: Sven Sandberg <sven.sandberg@oracle.com>,
pedro Figueiredo <pedro.figueiredo@oracle.com>
Change-Id: I78b2d081a1bc7cfc35d2c855901b38e86024feaa
When an APPEND access path is walked with the ENTIRE_TREE walk policy, the traversal stops and its children are never walked. The children are walked only when the walk policy is ENTIRE_QUERY_BLOCK or STOP_AT_MATERIALIZATION. This is incorrect because the expected behaviour is that traversal should continue only if the policy is ENTIRE_TREE. This is fixed by modifying the access path walk to traverse children of an APPEND only if the walk policy is ENTIRE_TREE. Change-Id: Icd2d294589a58ec18f091cbf5088f4c38b587c9a
…ong type This is a regression from bug#32915973. Before this bugfix, with a dynamic parameter that was derived as VARCHAR, and a parameter value with a temporal actual type was supplied, the query was reprepared so that the parameter was given the actual data type. This logic was lost in that bugfix. The solution here is to reinstate that logic. We have also added C API test cases to validate that correct data types are returned. Change-Id: I2448e3f2f36925fe70d882ae5681a6234f0d5a98
…rigger The problem is related to missing propagation of NULL values from the class Arg_comparator to the class Item_func_equal. The general class Item_bool_func2 has an is_nullable() property that is used to signal whether NULL values generated by Arg_comparator should be propagated to it. The Item_func_equal class is a subclass of Item_bool_func2, and is never nullable, however its logic is still depending on being able to read NULL value information from Arg_comparator. The Item_bool_func2 function set_cmp_func() tells Arg_comparator to propagate NULL values only when the function is nullable. This function also works for the class Item_func_equal when called by the resolver, because the is_nullable property is finally set after calling set_cmp_func(). But set_cmp_func() may also be called later, by fold_condition(), when the is_nullable property has been cleared. In this case, NULL value information is not propagated and we end up with wrong results. We go for a simple fix here, by making set_cmp_func() virtual and overriding it for class Item_func_equal by telling Arg_comparator to always propagate NULL values. Change-Id: Icb3aa1c30a6d10a82fe287a9f27f8fdd46087f59
Small improvements to show_rpl_debug_info.inc * Background show_rpl_debug_info.inc is sometimes used by tests to output debug info after a failure. It was written long ago and would benefit from some maintenance now. * Changes - When the file was written, mtr's loop feature only supported loops that iterate in decreasing order. Now it can iterate in increasing order, meaning we can make the output appear in a more natural order. - When the file was written, there was no easy way to show the error log. Now there is performance_schema.error_log. So we print it. - mtr echoes the last 30 lines of the test log to its stdout. Sometimes the full log is deleted and the 30 lines is all information we get. So it would help to put some of the more critical information there, in particular, any errors in the replication threads and the last errors from the error logs. - Use new terminology. - Improve formatting. Change-Id: I64629e5ab2eb89ee06b68518aabf22b9f86810cd
…ck.sql Skip ndb dictionary check before and after mtr testcase run if ndbinfo engine is not enabled since check uses ndbinfo table. Change-Id: I8dadca13e051f05d780ff4262adfd971e1b6aba3
Symptom: rpl_mts_spco_acl_commands_binlog and rpl_mts_spco_acl_commands_nobinlog failed after WL#13469. Analysis: The tests replicates a CREATE USER statement, which is held before committing due to replica-preserve-commit-order. At that point, it holds the metadata lock ACL CACHE in EXCLUSIVE mode. While CREATE USER is in this state, the test executes a number of checks, one of which is a SHOW GLOBAL VARIABLES statement. WL#13469 changed the execution of SHOW GLOBAL VARIABLES so that it needs to take the metadata lock ACL CACHE (in SHARED mode). Therefore, the execution of SHOW GLOBAL VARIABLES blocked the test. Since the test could not proceed, it did not reach the point where it unblocked the applier threads. Eventually the applier threads timed out, which made them stop with an error, and also abort the CREATE USER statement. Aborting CREATE USER also unblocked the SHOW GLOBAL VARIABLES, which allowed the test to proceed. But a little bit later, the test failed since it did not expect an error in the replication threads. Fix: Change the test to use SELECT @@global.variable instead of SHOW GLOBAL VARIABLES LIKE 'variable'. Change-Id: Id6772e2dabbcbd5627c846d5bb3c3cfe2a1279c8
Post push patch for fixing windows crash. Change-Id: I1735e7440525c6d201fb40c90ed15b922e7fc135
This patch fixes the x plugin. Configured with: -DWITH_MEB=0 -DWITHOUT_GROUP_REPLICATION=1 Change-Id: I857e7318f641fc8fb9bc92e8506d71975afde5eb (cherry picked from commit 3ffb476afa35665f072e389ad01142e54a001b6f)
…with failed constraint This patch fixes an inconsistency in the "Rows matched" info message returned from multi-table UPDATE IGNORE statements when some of the updates were rejected by a WITH CHECK OPTION clause in an updatable view. It was fixed for single-table UPDATE in the following bug: Bug#30158954: INCONSISTENT ROWS MATCHED VALUE FOR UPDATE WITH FAILED CONSTRAINT But the inconsistency could still be seen in multi-table UPDATE IGNORE if the updatable view was the first table of the join, and otherwise satisfied the requirements for immediate update. This patch applies the fix from Bug#30158954 to the multi-table code path as well. Change-Id: I042f2ffaa54edad6e5061eadf25a9e30055064c0
The CompressedBackup and CompressedLCP configuration parameter were ignored on Windows, they are now supported. If user had turned any of those on, upgrade will start compress corresponding files and there may be an increase in cpu usage for io threads. To get old behaviour back reconfigure with the compress parameters turned off. Change-Id: I4a3398c46e9ad67a8dbda08d345ffe1db077660d
In ndb_file_win32.cpp do not assume extend function is always called at beginning of file. That was true for raw files but not when using ndbxfrm1 for redo, undo, table space files. Change-Id: I658d5089eaabde18908b3d5b93977900f59db1c2
Fix signed/unsigned warning on Windows. Change-Id: Ife46b3df43698342bf4d3132d0736d15404f7204
Functions should return failure instead. Change-Id: I12bf23d84e83be6d8e3339b00a1f43e403879ce1
…e server to show the user
Description: Added more information to expired
password error message on error log
RB: 27665
…995 IN A FILE OPERATION. This specific error is not a hard error. It is an information and subject to retry the operation. It happens whenever a thread posts async IO and decided to close itself. In such case we will: - print only INFO, not ERROR, - immediately repeat the operation (from within the AIO handler thread that learned about the error) - `os_aio_windows_handler` retries the IO operation, but not using the SyncFileIO, which would be triggering an assertion (it can't be used for files opened for AIO), instead we just post another ReadFile/WriteFile to OS. - in `os_aio_windows_handler` a loop is added to handle completions until one succeeds. Change-Id: Id05c06e03d336c5c82ad830965e5dc655e38c989
Additional patch: run bison, to generate parser files run gen_lex_token to generate lex_token.h run gen_keyword_list to generate keyword_list.h Change-Id: I5bda1edf8a62d3d0f747717f71776fd5891429e0 (cherry picked from commit fb16d96c52188755e28feed11e8b5c6bbda4cdae)
When there are many operations belonging to still open transactions in
the hash list searched by Dblqh::findTransaction(), the hash buckets
becomes too filled. Thus there are too much CPU cycles consumed searcing
through the hash buckets.
The number of hash buckets are fixed to 4095, which is relatively
small considdered that we often configure the max number of operations
to much more than the default of 32k
This patch scales the size of the hash bucket relative to the
configured max number of operations, such that only a few items
should hash into the same bucket.
The same test case as reported in the bug report reduced its
elapsed run time to ~50%, and demonstrated a relative stable
insert rate: (Which decreased over time before this patch)
The select below select columns from a table just inserted into
in a single large transaction. Left column is the timestamp of
the insert with 100ms resolution, right column is number of
rows inserted in that periode.
mysql> select t, count(*) from t1 group by t order by t;
+------------+----------+
| t | count(*) |
+------------+----------+
| 22:40:42.3 | 22528 |
| 22:40:42.4 | 27104 |
| 22:40:42.5 | 24256 |
| 22:40:42.6 | 25344 |
| 22:40:42.7 | 18912 |
| 22:40:42.8 | 21408 |
| 22:40:42.9 | 25088 |
| 22:40:43.0 | 23328 |
| 22:40:43.1 | 20928 |
| 22:40:43.2 | 21408 |
| 22:40:43.3 | 21312 |
| 22:40:43.4 | 20640 |
+------------+----------+
(Refer to bug report for baseline results)
Change-Id: I8b818511f6ea4cc5911663e758b8525f7e433363
filesort() trusts item->max_char_length() and will pass it on to strnxfrom() when generating sort keys. If item->val_str() returns strings which are longer than max_char_length() we may hit an assert. We calculate max_length and max_char_length during resolving, and multiply and divide by collation->mbmaxlen. This must be done consistently for Item_func_hex::resolve_type() also. Change-Id: I3637e50c20295f2e0620ec6c67427b7a904a7647
Removed reorganize_ldm_bindings since it has an unexpected behavior. In same cases it is changing the thread binding even when they are already bound to the right cpu. Change-Id: Ie1bddf12c40cbc8bd65c892de0bc9fac140ee669
…::getElement() overhead When inserting lots of rows into an empty or small table, in the same transaction, we observe that the insert rate quickly declined to less then 50% of the initial rate, Using perf to observe where the CPU was spent, we observe that ~50% of all CPU was spent by Dbacc::getElement(). Root cause has been identified to be how the internal structures for storing the Dbacc 'Elements' are (not) resized in time. These structures are variants of hash list structures, which starts out small for an empty table, and are resized by sending a EXPAND-signal to itself when we detect that we are about to grow beyond a suitable limit. While the Dbacc 'Elements' are inserted into these structures immediately as the DBACC insert request is executed, the need for an expand was not checked until the DBACC got a commit request for the operation. Thus, for large insert transaction, the internal hash structures could be long overdue for a resize when the transaction finally commited. Note that we may also do a SHRINK at commit time if needed. However, the deleteElement() itself is also deferred until the delete operation is commited, so in the case of a delete+shrink that lines up with when the structures need to be reduced. This patch move the EXPAND and SHRINK check to immediately after where we inserted or deleted an Element from the hash structure. This also covers an INSERT later being aborted, as it will be executed as an insertElement() at the time if insertion, and later as a deleteElement() if it is aborted. This has a slightly increased cost over just checking at commit time, However, no performance regression for aborted inserts could be observed. This is not a case we should optimize for either. Re-test of the test case available for the bug, proves that there are a lot less drop in insert rates with this patch. Change-Id: Iad704bd9f9c8ff30471348fcb638bebace28ab33
… on PB2 daily runs The issue: after WL14592, if `ident` is a name of some plugin- or component-registered variables, then `SET PERSIST ident` and `RESET PERSIST ident` commands processed the name `ident` unmodified as it was entered by user (i.e. without any normalization e.g. transformation to lowercase or so). Thus, `SET PERSIST IdEnT=...` saved the name "IdEnT" into mysqld-auto.cnf, so `RESET PERSIST iDeNt` failed to recognize that "IdEnT" and "iDeNt" are names of the same variable. The fix forces a lowercase transformation of persisted variable names before saving/removing them to/from mysqld-auto.cnf. Change-Id: Id8182b1e27c27d99c68d5f4f3442508e79f5a441 (cherry picked from commit 7d7323f82a330520402a1770776ef6093faae615)
…ack_service in debug mode Post-push fix: error: unused variable 'LOCK_plugin' [-Werror=unused-variable] Change-Id: I89b1516acb953eb3ed28544569b00153334a8882 (cherry picked from commit e3c526539ee59450b163830e44c57da8656d612e)
…cial package On el6/el7, where -server-debug is not built, nothing obsoletes the community package in commercial upgrade. Add obsolete from -server to -server-debug to fix this. Change-Id: Ic3646fc063c8cf400dfffa4d38859b96e0c44009
…router packages Use of cluster macro was done be assignment Change-Id: I0cf8a9243d2043e60282b971a56cefcfd6d94ad2
…tables_fix.sql fails RB#27762 Fixed a typo in the upgrade script.
Added check that FSOPENCONF signal is only sent locally. Approved by: Frazer Clement <frazer.clement@oracle.com>
…be-uninitialized] LTO phase falsely reported error due to Wmaybe-uninitialized in function read_row in NdbInfoScanVirtual.cpp. Change-Id: I7be0e5f6be3ad6015e89df0f5335f7cfc18ca887
pull bot
pushed a commit
that referenced
this pull request
Apr 27, 2022
Patch #1 caused several problems in mysql-trunk related to ndbinfo initialization and upgrade, including the failure of the test ndb_76_inplace_upgrade and the failure of all NDB MTR tests in Pushbuild on Windows. This patch fixes these issues, including fixes for bug#33726826 and bug#33730799. In ndbinfo, revert the removal of ndb$blocks and ndb$index_stats and the change of blocks and index_stats from views to tables. Improve the ndbinfo schema upgrade & initialization logic to better handle such a change in the future. This logic now runs in two passes: first it drops the known tables and views from current and previous versions, then it creates the tables and views for the current version. Add a new class method NdbDictionary::printColumnTypeDescription(). This is needed for the ndbinfo.columns table in patch #2 but was missing from patch #1. Add boilerplate index lookup initialization code that was also missing. Fix ndbinfo prefix determination on Windows. Change-Id: I422856bcad4baf5ae9b14c1e3a1f2871bd6c5f59
pull bot
pushed a commit
that referenced
this pull request
Jul 28, 2022
* PROBLEM The test "ndb.ndb_bug17624736" was constantly failing in [daily|weekly]-8.0-cluster branches in PB2, whether on `ndb-ps` or `ndb-default-big` profile test runs. The high-level reason for the failure was the installation of a duplicate entry in the Data Dictionary in respect to the `engine`-`se_private_id` pair, even when the previous table definition should have been dropped. * LOW-LEVEL EXPLANATION NDB reuses the least available ID for the dictionary table ID. The ID is then used by the NDB plugin to install as SE private ID field of the MySQL Data Dictionary table definition. If a problem occurs during the synchronization of NDB table definitions in the Data Dictionary (i.e., a previous definition was not successfully removed), then an attempt to install a table using an already installed SE private ID can occur. If that ID was inadvertedly cached as `missing`, then the function `acquire_uncached_table_by_se_private_id` will return fast without retrieving the table definition. Therefore, the old table definition on that ID cannot be retrieved ever for that Data Dictionary client instance, the new one won't be installed, and errors will be raised. * SOLUTION For NDB plugin to query a table definition, using the SE private ID (without causing a missing entry to be cached forever for that client instance), this patch adds a flag argument to the function to allow the caller to request it to skip the fast cache. Change-Id: I45eef594ee544000fe6b30b86977e5e91155dc80
pull bot
pushed a commit
that referenced
this pull request
Jul 28, 2022
-- Patch #1: Persist secondary load information -- Problem: We need a way of knowing which tables were loaded to HeatWave after MySQL restarts due to a crash or a planned shutdown. Solution: Add a new "secondary_load" flag to the `options` column of mysql.tables. This flag is toggled after a successful secondary load or unload. The information about this flag is also reflected in INFORMATION_SCHEMA.TABLES.CREATE_OPTIONS. -- Patch #2 -- The second patch in this worklog triggers the table reload from InnoDB after MySQL restart. The recovery framework recognizes that the system restarted by checking whether tables are present in the Global State. If there are no tables present, the framework will access the Data Dictionary and find which tables were loaded before the restart. This patch introduces the "Data Dictionary Worker" - a MySQL service recovery worker whose task is to query the INFORMATION_SCHEMA.TABLES table from a separate thread and find all tables whose secondary_load flag is set to 1. All tables that were found in the Data Dictionary will be appended to the list of tables that have to be reloaded by the framework from InnoDB. If an error occurs during restart recovery we will not mark the recovery as failed. This is done because the types of failures that can occur when the tables are reloaded after a restart are less critical compared to previously existing recovery situations. Additionally, this code will soon have to be adapted for the next worklog in this area so we are proceeding with the simplest solution that makes sense. A Global Context variable m_globalStateEmpty is added which indicates whether the Global State should be recovered from an external source. -- Patch #3 -- This patch adds the "rapid_reload_on_restart" system variable. This variable is used to control whether tables should be reloaded after a restart of mysqld or the HeatWave plugin. This variable is persistable (i.e., SET PERSIST RAPID_RELOAD_ON_RESTART = TRUE/FALSE). The default value of this variable is set to false. The variable can be modified in OFF, IDLE, and SUSPENDED states. -- Patch #4 -- This patch refactors the recovery code by removing all recovery-related code from ha_rpd.cc and moving it to separate files: - ha_rpd_session_factory.h/cc: These files contain the MySQLAdminSessionFactory class, which is used to create admin sessions in separate threads that can be used to issue SQL queries. - ha_rpd_recovery.h/cc: These files contain the MySQLServiceRecoveryWorker, MySQLServiceRecoveryJob and ObjectStoreRecoveryJob classes which were previously defined in ha_rpd.cc. This file also contains a function that creates the RecoveryWorkerFactory object. This object is passed to the constructor of the Recovery Framework and is used to communicate with the other section of the code located in rpdrecoveryfwk.h/cc. This patch also renames rpdrecvryfwk to rpdrecoveryfwk for better readability. The include relationship between the files is shown on the following diagram: rpdrecoveryfwk.h◄──────────────rpdrecoveryfwk.cc ▲ ▲ │ │ │ │ │ └──────────────────────────┐ │ │ ha_rpd_recovery.h◄─────────────ha_rpd_recovery.cc──┐ ▲ │ │ │ │ │ │ │ │ │ ▼ │ ha_rpd.cc───────────────────────►ha_rpd.h │ ▲ │ │ │ ┌───────────────────────────────┘ │ │ ▼ ha_rpd_session_factory.cc──────►ha_rpd_session_factory.h Other changes: - In agreement with Control Plane, the external Global State is now invalidated during recovery framework startup if: 1) Recovery framework recognizes that it should load the Global State from an external source AND, 2) rapid_reload_on_restart is set to OFF. - Addressed review comments for Patch #3, rapid_reload_on_restart is now also settable while plugin is ON. - Provide a single entry point for processing external Global State before starting the recovery framework loop. - Change when the Data Dictionary is read. Now we will no longer wait for the HeatWave nodes to connect before querying the Data Dictionary. We will query it when the recovery framework starts, before accepting any actions in the recovery loop. - Change the reload flow by inserting fake global state entries for tables that need to be reloaded instead of manually adding them to a list of tables scheduled for reload. This method will be used for the next phase where we will recover from Object Storage so both recovery methods will now follow the same flow. - Update secondary_load_dd_flag added in Patch #1. - Increase timeout in wait_for_server_bootup to 300s to account for long MySQL version upgrades. - Add reload_on_restart and reload_on_restart_dbg tests to the rapid suite. - Add PLUGIN_VAR_PERSIST_AS_READ_ONLY flag to "rapid_net_orma_port" and "rapid_reload_on_restart" definitions, enabling their initialization from persisted values along with "rapid_bootstrap" when it is persisted as ON. - Fix numerous clang-tidy warnings in recovery code. - Prevent suspended_basic and secondary_load_dd_flag tests to run on ASAN builds due to an existing issue when reinstalling the RAPID plugin. -- Bug#33752387 -- Problem: A shutdown of MySQL causes a crash in queries fired by DD worker. Solution: Prevent MySQL from killing DD worker's queries by instantiating a DD_kill_immunizer before the queries are fired. -- Patch #5 -- Problem: A table can be loaded before the DD Worker queries the Data Dictionary. This means that table will be wrongly processed as part of the external global state. Solution: If the table is present in the current in-memory global state we will not consider it as part of the external global state and we will not process it by the recovery framework. -- Bug#34197659 -- Problem: If a table reload after restart causes OOM the cluster will go into RECOVERYFAILED state. Solution: Recognize when the tables are being reloaded after restart and do not move the cluster into RECOVERYFAILED. In that case only the current reload will fail and the reload for other tables will be attempted. Change-Id: Ic0c2a763bc338ea1ae6a7121ff3d55b456271bf0
pull bot
pushed a commit
that referenced
this pull request
Oct 11, 2022
Enh#34350907 - [Nvidia] Allow DDLs when tables are loaded to HeatWave
Bug#34433145 - WL#15129: mysqld crash Assertion `column_count == static_cast<int64_t>(cp_table-
Bug#34446287 - WL#15129: mysqld crash at rapid::data::RapidNetChunkCtx::consolidateEncodingsDic
Bug#34520634 - MYSQLD CRASH : Sql_cmd_secondary_load_unload::mysql_secondary_load_or_unload
Bug#34520630 - Failed Condition: "table_id != InvalidTableId"
Currently, DDL statements such as ALTER TABLE*, RENAME TABLE, and
TRUNCATE TABLE are not allowed if a table has a secondary engine
defined. The statements fail with the following error: "DDLs on a table
with a secondary engine defined are not allowed."
This worklog lifts this restriction for tables whose secondary engine is
RAPID.
A secondary engine hook is called in the beginning (pre-hook) and in the
end (post-hook) of a DDL statement execution. If the DDL statement
succeeds, the post-hook will direct the recovery framework to reload the
table in order to reflect that change in HeatWave.
Currently all DDL statements that were previously disallowed will
trigger a reload. This can be improved in the future by checking whether
the DDL operation has an impact on HeatWave or not. However detecting
all edge-cases in this behavior is not straightforward so this
improvement has been left as a future improvement.
Additionally, if a DDL modifies the table schema in a way that makes it
incompatible with HeatWave (e.g., dropping a primary key column) the
reload will fail silently. There is no easy way to recognize whether the
table schema will become incompatible with HeatWave in a pre-hook.
List of changes:
1) [MySQL] Add new HTON_SECONDARY_ENGINE_SUPPORTS_DDL flag to indicate
whether a secondary engine supports DDLs.
2) [MySQL] Add RAII hooks for RENAME TABLE and TRUNCATE TABLE, modeled
on the ALTER TABLE hook.
3) Define HeatWave hooks for ALTER TABLE, RENAME TABLE, and TRUNCATE
TABLE statements.
4) If a table reload is necessary, trigger it by marking the table as
stale (WL#14914).
4) Move all change propagation & DDL hooks to ha_rpd_hooks.cc.
5) Adjust existing tests to support table reload upon DDL execution.
6) Extract code related to RapidOpSyncCtx in ha_rpd_sync_ctx.cc, and
the PluginState enum to ha_rpd_fsm.h.
* Note: ALTER TABLE statements related to secondary engine setting and
loading were allowed before:
- ALTER TABLE <TABLE> SECONDARY_UNLOAD,
- ALTER TABLE SECONDARY_ENGINE = NULL.
-- Bug#34433145 --
-- Bug#34446287 --
--Problem #1--
Crashes in Change Propagation when the CP thread tries to apply DMLs of
tables with new schema to the not-yet-reloaded table in HeatWave.
--Solution #1--
Remove table from Change Propagation before marking it as stale and
revert the original change from rpd_binlog_parser.cc where we were
checking if the table was stale before continuing with binlog parsing.
The original change is no longer necessary since the table is removed
from CP before being marked as stale.
--Problem #2--
In case of a failed reload, tables are not removed from Global State.
--Solution #2--
Keep track of whether the table was reloaded because it was marked as
STALE. In that case we do not want the Recovery Framework to retry the
reload and therefore we can remove the table from the Global State.
-- Bug#34520634 --
Problem:
Allowing the change of primary engine for tables with a defined
secondary engine hits an assertion in mysql_secondary_load_or_unload().
Example:
CREATE TABLE t1 (col1 INT PRIMARY KEY) SECONDARY_ENGINE = RAPID;
ALTER TABLE t1 ENGINE = BLACKHOLE;
ALTER TABLE t1 SECONDARY_LOAD; <- assertion hit here
Solution:
Disallow changing the primary engine for tables with a defined secondary
engine.
-- Bug#34520630 --
Problem:
A debug assert is being hit in rapid_gs_is_table_reloading_from_stale
because the table was dropped in the meantime.
Solution:
Instead of asserting, just return false if table is not present in the
Global State.
This patch also changes rapid_gs_is_table_reloading_from_stale to a more
specific check (inlined the logic in load_table()). This check now also
covers the case when a table was dropped/unloaded before the Recovery
Framework marked it as INRECOVERY. In that case, if the reload fails we
should not have an entry for that table in the Global State.
The patch also adjusts dict_types MTR test, where we no longer expect
for tables to be in UNAVAIL state after a failed reload. Additionally,
recovery2_ddls.test is adjusted to not try to offload queries running on
Performance Schema.
Change-Id: I6ee390b1f418120925f5359d5e9365f0a6a415ee
pull bot
pushed a commit
that referenced
this pull request
Jan 17, 2023
… Signal (get_store_key at sql/sql_select.cc:2383) These are two related but distinct problems manifested in the shrinkage of key definitions for derived tables or common table expressions, implemented in JOIN::finalize_derived_keys(). The problem in Bug#34572040 is that we have two references to one CTE, each with a valid key definition. The function will first loop over the first reference (cte_a) and move its used key from position 0 to position 1. Next, it will attempt to move the key for the second reference (cte_b) from position 4 to position 2. However, for each iteration, the function will calculate used key information. On the first iteration, the values are correct, but since key value #1 has been moved into position #0, the old information is invalid and provides wrong information. The problem is thus that for subsequent iterations we read data that has been invalidated by earlier key moves. The best solution to the problem is to move the keys for all references to the CTE in one operation. This way, we can calculate used keys information safely, before any move operation has been performed. The problem in Bug#34634469 is also related to having more than one reference to a CTE, but in this case the first reference (ref_3) has a key in position 5 which is moved to position 0, and the second reference (ref_4) has a key in position 3 that is moved to position 1. However, the key parts of the first key will overlap with the key parts of the second key after the first move, thus invalidating the key structure during the copy. The actual problem is that we move a higher-numbered key (5) before a lower-numbered key (3), which in this case makes it impossible to find an empty space for the moved key. The solution to this problem is to ensure that keys are moved in increasing key order. The patch changes the algorithm as follows: - When identifying a derived table/common table expression, ensure to move all its keys in one operation (at least those references from the same query block). - First, collect information about all key uses: hash key, unique index keys and actual key references. For the key references, also populate a mapping array that enumerates table references with key references in order of increasing key number. Also clear used key information for references that do not use keys. - For each table reference with a key reference in increasing key order, move the used key into the lowest available position. This will ensure that used entries are never overwritten. - When all table references have been processed, remove unused key definitions. Change-Id: I938099284e34a81886621f6a389f34abc51e78ba
pull bot
pushed a commit
that referenced
this pull request
Apr 27, 2023
The shadow tables used by ndb_binlog thread when handling data events have no knowledge about wheter the table is a foreign key parent in NDB, this is mainly because the NDB dictionary extra metadata for parent table is not updated when creating the child tables. The information about being parent table is required in order to properly detect a transaction conflict while writing changes to the binlog for changes of parent key tables. This is fixed by extending the ndb_binlog thread with a metadata cache that maintains a list of tables in NDB which are foreign key parents. This makes it possible to update the shadow table's knowledge about being parent table while handling data events. Change-Id: Ic551fde3e9460e3668d5aa1ac951ee3bec442cf5
pull bot
pushed a commit
that referenced
this pull request
Apr 27, 2023
If mysql_bind_param() fails, it crashes. glibc reports: double free or corruption (fasttop) ASAN reports: heap-use-after-free #1 0x55ad770cda23 in mysql_bind_param libmysql/libmysql.cc:2477:9 freed by thread T0 here: #1 0x55ad770cda23 in mysql_bind_param libmysql/libmysql.cc:2477:9 The wrong counter-variable is used which results in the same index being freed again and again. Change ------ - use the right index-variable when freeing ->names if mysql_bind_param() fails. Change-Id: I580267d5913c55b00151409c25d90f2ffe1b4119
pull bot
pushed a commit
that referenced
this pull request
Apr 27, 2023
Compilation warning/error: storage/ndb/test/src/UtilTransactions.cpp:1544: error: variable 'eof' may be uninitialized when used here [-Werror,-Wconditional- uninitialized] Manual code inspection also shows there are problems with retry logic as well as potentially releasing resources. Fix by refactoring ´verifyTableReplicasWithSource` into functions where the retry, scan and compare logic are separated. This makes it possible to make sure that the "eof" variable is always initialized while fetching the next row during scan. Change-Id: I111e0a6613622aa2279a5ec5845e48e8ca0e115f
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )