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

PXB-3295 : Undo tablespaces are not tracked properly with lock-ddl=RE… #1586

Merged

Conversation

satya-bodapati
Copy link
Contributor

…DUCED

Problem:

Undo tablespaces are not tracked properly. Since undo tablespaces are not opened via fil_open_for_xtrabackup(), they are not tracked as 'copied'. This leads to wrong decisions in handle_ddl_operations.

When new undo tablespaces are created,
Server doesn't write a MLOG_FILE_CREATE record and so these are missed by the tracking system.

Fix:

  1. track undo tablespaces that xtrabackup copies without lock (before lock state)
  2. After lock is taken, undo tablespces are discovered again (after lock state)

With this before and after states, we now determine undo files to be deleted, undo files to be copied. Truncated undo tablespace use different tablespace id, so old undo file is marked as deleted and new version of undo tablespace is copied

For example undo_001.ibu of space_id 10 is truncated, the filename remains same but it space_id becomes 11. xtrabackup creates 11.ibu.del for undo tablespace to be deleted. then undo_001.ibu.new with space_id 11 is copied under lock

…DUCED

Problem:
--------
1.
Undo tablespaces are not tracked properly. Since undo tablespaces are not opened via
fil_open_for_xtrabackup(), they are not tracked as 'copied'. This leads to wrong
decisions in handle_ddl_operations.

2.
When new undo tablespaces are created,
Server doesn't write a MLOG_FILE_CREATE record and so these are missed by the tracking
system.

Fix:
----
1. track undo tablespaces that xtrabackup copies without lock (before lock state)
2. After lock is taken, undo tablespces are discovered again (after lock state)

With this before and after states, we now determine undo files to be deleted,
undo files to be copied. Truncated undo tablespace use different tablespace id, so
old undo file is marked as deleted and new version of undo tablespace is copied

For example undo_001.ibu of space_id 10 is truncated, the filename remains same
but it space_id becomes 11. xtrabackup creates 11.ibu.del for undo tablespace to be deleted.
then undo_001.ibu.new with space_id 11 is copied under lock
@satya-bodapati satya-bodapati self-assigned this Jul 17, 2024
@satya-bodapati satya-bodapati merged commit 2fe6a4d into percona:dev-reducedlock-trunk Jul 18, 2024
5 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.

1 participant