Skip to content

Commit e81af7f

Browse files
committed
Minor cleanup
1 parent bd80d15 commit e81af7f

1 file changed

Lines changed: 13 additions & 20 deletions

File tree

storage/innobase/handler/backup_innodb.cc

Lines changed: 13 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -93,19 +93,18 @@ class InnoDB_backup
9393

9494
if (!fail)
9595
{
96-
ctx= new backup_context{};
97-
ctx->first_lsn= log_sys.get_first_lsn();
98-
ctx->max_first_lsn= 1;
99-
ctx->first_size= log_sys.file_size;
100-
const lsn_t start= ctx->checkpoint=
96+
lsn_t start_end;
97+
const lsn_t start=
10198
#if 1 /* TODO: for incremental backup, allow the start to be specified */
102-
log_sys.get_latest_checkpoint(ctx->checkpoint_end_lsn);
99+
log_sys.get_latest_checkpoint(start_end);
103100
#else
104101
log_sys.archived_checkpoint;
105-
ctx->checkpoint_end_lsn= log_sys.archived_lsn;
102+
start_end= log_sys.archived_lsn;
106103
#endif
107-
ctx->last_lsn= 0;
108-
ctx->archived= !old_size;
104+
ctx= new backup_context{
105+
log_sys.get_first_lsn(), 1, log_sys.file_size,
106+
start, start_end, 0, !old_size
107+
};
109108

110109
/* Collect all tablespaces that have been created before our
111110
start checkpoint. Newer tablespaces will be recovered by the
@@ -144,14 +143,12 @@ class InnoDB_backup
144143
/**
145144
Process a file that was collected at init().
146145
This may be invoked from multiple concurrent threads.
147-
@param thd current session
148146
@param target backup target
149147
@param sink backup worker context
150148
@return number of files remaining, or negative on error
151149
@retval 0 on completion
152150
*/
153-
int step(THD *thd, const backup_target &target, const backup_sink &sink)
154-
noexcept
151+
int step(const backup_target &target, const backup_sink &sink) noexcept
155152
{
156153
uint32_t id= FIL_NULL;
157154
lsn_t lsn= 0;
@@ -241,13 +238,11 @@ class InnoDB_backup
241238
const backup_sink &sink) noexcept
242239
{
243240
ut_ad(ctx ? ctx == sink.ha_data : phase == BACKUP_PHASE_FINISH);
244-
ut_ad(sink.stream == sink.NO_STREAM); // FIXME
245241

246242
switch (phase) {
247243
default:
248244
return 0;
249245
case BACKUP_PHASE_FINISH:
250-
return fini(thd, target, sink);
251246
case BACKUP_PHASE_NO_COMMIT:
252247
case BACKUP_PHASE_ABORT:
253248
break;
@@ -265,7 +260,7 @@ class InnoDB_backup
265260
if (!ctx)
266261
cleanup();
267262
log_sys.latch.wr_unlock();
268-
return fini(thd, target, sink);
263+
return fini(target, sink);
269264
default:
270265
/* Determine the logical time of the backup snapshot */
271266
ut_ad(phase == BACKUP_PHASE_NO_COMMIT);
@@ -355,14 +350,12 @@ class InnoDB_backup
355350

356351
/**
357352
Clean up after end().
358-
@param thd the parameter that had been passed to end()
359353
@param target backup target
360354
@param sink backup worker context
361355
@return error code
362356
@retval 0 on success
363357
*/
364-
int fini(THD *thd, const backup_target &target, const backup_sink &sink)
365-
noexcept
358+
int fini(const backup_target &target, const backup_sink &sink) noexcept
366359
{
367360
int fail= 0;
368361

@@ -1022,11 +1015,11 @@ void *innodb_backup_start(THD *thd, const backup_target *target,
10221015
: sink->ha_data;
10231016
}
10241017

1025-
int innodb_backup_step(THD *thd, const backup_target *target,
1018+
int innodb_backup_step(THD *, const backup_target *target,
10261019
backup_phase phase, const backup_sink *sink) noexcept
10271020
{
10281021
return phase == BACKUP_PHASE_START &&
1029-
innodb_backup.step(thd, *target, *sink);
1022+
innodb_backup.step(*target, *sink);
10301023
}
10311024

10321025
int innodb_backup_end(THD *thd, const backup_target *target,

0 commit comments

Comments
 (0)