Backup_context is copied several times during backup process

Description

The Backup_context object should been one copy during backup process, and the all function pass it by reference. However, in function backup_files bind the argument by value, that will cause needless copy, destructor. And, if the Backup_context contain some global status, it may cause unexpected error.

 

Improvement method:

 bool backup_files(const char *from, bool prep_mode, Backup_context &context) {

   run_data_threads(from,
                    std::bind(backup_thread_func, std::placeholders::_1,

  •                             prep_mode, rsync_tmpfile, context),
    +                             prep_mode, rsync_tmpfile, std::ref(context)),
                        xtrabackup_parallel, "backup");

Environment

None

Activity

Show:

Aaditya Dubey March 6, 2023 at 10:33 AM

Hi ,

Thank you for the report.
Sending the concern to engineering for further review and updates.

Details

Assignee

Reporter

Labels

Needs Review

Yes

Needs QA

Yes

Affects versions

Priority

Smart Checklist

Created March 2, 2023 at 12:57 AM
Updated June 7, 2024 at 2:25 PM