MySQL 8.0.31
Source Code Documentation
clone0desc.h
Go to the documentation of this file.
1/*****************************************************************************
2
3Copyright (c) 2017, 2022, Oracle and/or its affiliates.
4
5This program is free software; you can redistribute it and/or modify it under
6the terms of the GNU General Public License, version 2.0, as published by the
7Free Software Foundation.
8
9This program is also distributed with certain software (including but not
10limited to OpenSSL) that is licensed under separate terms, as designated in a
11particular file or component or in included license documentation. The authors
12of MySQL hereby grant you an additional permission to link the program and
13your derivative works with the separately licensed software that they have
14included with MySQL.
15
16This program is distributed in the hope that it will be useful, but WITHOUT
17ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
18FOR A PARTICULAR PURPOSE. See the GNU General Public License, version 2.0,
19for more details.
20
21You should have received a copy of the GNU General Public License along with
22this program; if not, write to the Free Software Foundation, Inc.,
2351 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
24
25*****************************************************************************/
26
27/** @file include/clone0desc.h
28 Innodb clone descriptors
29
30 *******************************************************/
31
32#ifndef CLONE_DESC_INCLUDE
33#define CLONE_DESC_INCLUDE
34
35#include "mem0mem.h"
36#include "os0file.h"
37#include "univ.i"
38
39/** Invalid locator ID. */
40const uint64_t CLONE_LOC_INVALID_ID = 0;
41
42/** Maximum base length for any serialized descriptor. This is only used for
43optimal allocation and has no impact on version compatibility. */
46/** Align by 4K for O_DIRECT */
47const uint32_t CLONE_ALIGN_DIRECT_IO = 4 * 1024;
48
49/** Maximum number of concurrent tasks for each clone */
50const int CLONE_MAX_TASKS = 128;
51
52/** Snapshot state transfer during clone.
53
54Clone Type: HA_CLONE_BLOCKING
55@startuml
56 state CLONE_SNAPSHOT_INIT
57 state CLONE_SNAPSHOT_FILE_COPY
58 state CLONE_SNAPSHOT_DONE
59
60 [*] -down-> CLONE_SNAPSHOT_INIT : Build snapshot
61 CLONE_SNAPSHOT_INIT -right-> CLONE_SNAPSHOT_FILE_COPY
62 CLONE_SNAPSHOT_FILE_COPY -right-> CLONE_SNAPSHOT_DONE
63 CLONE_SNAPSHOT_DONE -down-> [*] : Destroy snapshot
64@enduml
65
66Clone Type: HA_CLONE_REDO
67@startuml
68 state CLONE_SNAPSHOT_REDO_COPY
69
70 [*] -down-> CLONE_SNAPSHOT_INIT : Build snapshot
71 CLONE_SNAPSHOT_INIT -right-> CLONE_SNAPSHOT_FILE_COPY : Start redo archiving
72 CLONE_SNAPSHOT_FILE_COPY -right-> CLONE_SNAPSHOT_REDO_COPY
73 CLONE_SNAPSHOT_REDO_COPY -right-> CLONE_SNAPSHOT_DONE
74 CLONE_SNAPSHOT_DONE -down-> [*] : Destroy snapshot
75@enduml
76
77Clone Type: HA_CLONE_HYBRID
78@startuml
79 state CLONE_SNAPSHOT_PAGE_COPY
80
81 [*] -down-> CLONE_SNAPSHOT_INIT : Build snapshot
82 CLONE_SNAPSHOT_INIT -right-> CLONE_SNAPSHOT_FILE_COPY : Start page tracking
83 CLONE_SNAPSHOT_FILE_COPY -right-> CLONE_SNAPSHOT_PAGE_COPY : Start redo \
84 archiving
85 CLONE_SNAPSHOT_PAGE_COPY -right-> CLONE_SNAPSHOT_REDO_COPY
86 CLONE_SNAPSHOT_REDO_COPY -right> CLONE_SNAPSHOT_DONE
87 CLONE_SNAPSHOT_DONE -down-> [*] : Destroy snapshot
88@enduml
89
90Clone Type: HA_CLONE_PAGE: Not implemented
91*/
92enum Snapshot_State : uint32_t {
93 /** Invalid state */
95
96 /** Initialize state when snapshot object is created */
98
99 /** Snapshot state while transferring files. */
101
102 /** Snapshot state while transferring pages. */
104
105 /** Snapshot state while transferring redo. */
107
108 /** Snapshot state at end after finishing transfer. */
111
112/** Total number of data transfer stages in clone. */
114
115/** Choose lowest descriptor version between reference locator
116and currently supported version.
117@param[in] ref_loc reference locator
118@return chosen version */
119uint choose_desc_version(const byte *ref_loc);
120
121/** Check if clone locator is valid
122@param[in] desc_loc serialized descriptor
123@param[in] desc_len descriptor length
124@return true, if valid locator */
125bool clone_validate_locator(const byte *desc_loc, uint desc_len);
126
127/** Clone descriptors contain meta information needed for applying cloned data.
128These are PODs with interface to serialize and deserialize them. */
130 /** Logical pointer to identify a clone operation */
132
133 /** Metadata for a Task/Thread for clone operation */
135
136 /** Information for snapshot state */
138
139 /** Metadata for a database file */
141
142 /** Information for a data block */
144
145 /** Must be the last member */
148
149/** Header common to all descriptors. */
151 /** Descriptor version */
153
154 /** Serialized length of descriptor in bytes */
156
157 /** Descriptor type */
159
160 /** Serialize the descriptor header: Caller must allocate
161 the serialized buffer.
162 @param[out] desc_hdr serialized header */
163 void serialize(byte *desc_hdr);
164
165 /** Deserialize the descriptor header.
166 @param[in] desc_hdr serialized header
167 @param[in] desc_len descriptor length
168 @return true, if successful. */
169 bool deserialize(const byte *desc_hdr, uint desc_len);
170};
171
172/** Task information in clone operation. */
174 /** Index in task array. */
176
177 /** Current chunk number reserved by the task. */
179
180 /** Current block number that is already transferred. */
182};
183
184/** Map for current block number for unfinished chunks. Used during
185restart from incomplete clone operation. */
186using Chunk_Map = std::map<uint32_t, uint32_t>;
187
188/** Bitmap for completed chunks in current state */
190 public:
191 /** Construct bitmap */
193
194 /** Bitmap array index operator implementation */
196 public:
197 /** Construct bitmap operator
198 @param[in] bitmap reference to bitmap buffer
199 @param[in] index array operation index */
200 Bitmap_Operator_Impl(uint32_t *&bitmap, uint32_t index)
201
202 : m_bitmap_ref(bitmap) {
203 /* BYTE position */
204 auto byte_index = index >> 3;
205 ut_ad(byte_index == index / 8);
206
207 /* MAP array position */
208 m_map_index = byte_index >> 2;
209 ut_ad(m_map_index == byte_index / 4);
210
211 /* BIT position */
212 auto bit_pos = index & 31;
213 ut_ad(bit_pos == index % 32);
214
215 m_bit_mask = 1 << bit_pos;
216 }
217
218 /** Check value at specified index in BITMAP
219 @return true if the BIT is set */
220 operator bool() const {
221 auto &val = m_bitmap_ref[m_map_index];
222
223 if ((val & m_bit_mask) == 0) {
224 return (false);
225 }
226
227 return (true);
228 }
229
230 /** Set BIT at specific index
231 @param[in] bit bit value to set */
232 void operator=(bool bit) {
233 auto &val = m_bitmap_ref[m_map_index];
234
235 if (bit) {
236 val |= m_bit_mask;
237 } else {
238 val &= ~m_bit_mask;
239 }
240 }
241
242 private:
243 /** Reference to BITMAP array */
244 uint32_t *&m_bitmap_ref;
245
246 /** Current array position */
247 uint32_t m_map_index;
248
249 /** Mask with current BIT set */
250 uint32_t m_bit_mask;
251 };
252
253 /** Array index operator
254 @param[in] index bitmap array index
255 @return operator implementation object */
257 /* Convert to zero based index */
258 --index;
259
260 ut_a(index < m_bits);
261 return (Bitmap_Operator_Impl(m_bitmap, index));
262 }
263
264 /** Reset bitmap with new size
265 @param[in] max_bits number of BITs to hold
266 @param[in] heap heap for allocating memory
267 @return old buffer pointer */
268 uint32_t *reset(uint32_t max_bits, mem_heap_t *heap);
269
270 /** Get minimum BIT position that is not set
271 @return BIT position */
272 uint32_t get_min_unset_bit();
273
274 /** Get maximum BIT position that is not set
275 @return BIT position */
276 uint32_t get_max_set_bit();
277
278 /** Serialize the descriptor. Caller should pass
279 the length if allocated.
280 @param[out] desc_chunk serialized chunk info
281 @param[in,out] len length of serialized descriptor */
282 void serialize(byte *&desc_chunk, uint &len);
283
284 /** Deserialize the descriptor.
285 @param[in] desc_chunk serialized chunk info
286 @param[in,out] len_left length left in bytes */
287 void deserialize(const byte *desc_chunk, uint &len_left);
288
289 /** Get the length of serialized data
290 @return length serialized chunk info */
291 size_t get_serialized_length();
292
293 /** Maximum bit capacity
294 @return maximum number of BITs it can hold */
295 size_t capacity() const { return (8 * size()); }
296
297 /** Size of bitmap in bytes
298 @return BITMAP buffer size */
299 size_t size() const { return (m_size * 4); }
300
301 /** Size of bitmap in bits
302 @return number of BITs stored */
303 uint32_t size_bits() const { return (m_bits); }
304
305 private:
306 /** BITMAP buffer */
307 uint32_t *m_bitmap;
308
309 /** BITMAP buffer size: Number of 4 byte blocks */
310 size_t m_size;
311
312 /** Total number of BITs in the MAP */
313 uint32_t m_bits;
314};
315
316/** Incomplete Chunk information */
318 /** Information about chunks completed */
320
321 /** Information about unfinished chunks */
323
324 /** Chunks for current state */
326
327 /** Minimum chunk number that is not reserved yet */
329
330 /** Maximum chunk number that is already reserved */
332
333 /** Initialize Chunk number ranges */
337
340 }
341
342 /** Serialize the descriptor. Caller should pass
343 the length if allocated.
344 @param[out] desc_chunk serialized chunk info
345 @param[in,out] len length of serialized descriptor */
346 void serialize(byte *desc_chunk, uint &len);
347
348 /** Deserialize the descriptor.
349 @param[in] desc_chunk serialized chunk info
350 @param[in,out] len_left length left in bytes */
351 void deserialize(const byte *desc_chunk, uint &len_left);
352
353 /** Get the length of serialized data
354 @param[in] num_tasks number of tasks to include
355 @return length serialized chunk info */
356 size_t get_serialized_length(uint32_t num_tasks);
357};
358
359/** CLONE_DESC_LOCATOR: Descriptor for a task for clone operation.
360A task is used by exactly one thread */
362 /** Descriptor header */
364
365 /** Unique identifier for a clone operation. */
366 uint64_t m_clone_id;
367
368 /** Unique identifier for a clone snapshot. */
370
371 /** Index in clone array for fast reference. */
373
374 /** Current snapshot State */
376
377 /** Sub-state information: metadata transferred */
379
380 /** Initialize clone locator.
381 @param[in] id Clone identifier
382 @param[in] snap_id Snapshot identifier
383 @param[in] state snapshot state
384 @param[in] version Descriptor version
385 @param[in] index clone index */
386 void init(uint64_t id, uint64_t snap_id, Snapshot_State state, uint version,
387 uint index);
388
389 /** Check if the passed locator matches the current one.
390 @param[in] other_desc input locator descriptor
391 @return true if matches */
392 bool match(Clone_Desc_Locator *other_desc);
393
394 /** Serialize the descriptor. Caller should pass
395 the length if allocated.
396 @param[out] desc_loc serialized descriptor
397 @param[in,out] len length of serialized descriptor
398 @param[in] chunk_info chunk information to serialize
399 @param[in] heap heap for allocating memory */
400 void serialize(byte *&desc_loc, uint &len, Chunk_Info *chunk_info,
401 mem_heap_t *heap);
402
403 /** Deserialize the descriptor.
404 @param[in] desc_loc serialized locator
405 @param[in] desc_len locator length
406 @param[in,out] chunk_info chunk information */
407 void deserialize(const byte *desc_loc, uint desc_len, Chunk_Info *chunk_info);
408};
409
410/** CLONE_DESC_TASK_METADATA: Descriptor for a task for clone operation.
411A task is used by exactly one thread */
413 /** Descriptor header */
415
416 /** Task information */
418
419 /** Initialize header
420 @param[in] version descriptor version */
422
423 /** Serialize the descriptor. Caller should pass
424 the length if allocated.
425 @param[out] desc_task serialized descriptor
426 @param[in,out] len length of serialized descriptor
427 @param[in] heap heap for allocating memory */
428 void serialize(byte *&desc_task, uint &len, mem_heap_t *heap);
429
430 /** Deserialize the descriptor.
431 @param[in] desc_task serialized descriptor
432 @param[in] desc_len descriptor length
433 @return true, if successful. */
434 bool deserialize(const byte *desc_task, uint desc_len);
435};
436
437/** CLONE_DESC_STATE: Descriptor for current snapshot state */
439 /** Descriptor header */
441
442 /** Current snapshot State */
444
445 /** Task identifier */
447
448 /** Number of chunks in current state */
450
451 /** Number of files in current state */
453
454 /** Number of estimated bytes to transfer */
455 uint64_t m_estimate;
456
457 /** Number of estimated bytes on disk */
459
460 /** If start processing state */
462
463 /** State transfer Acknowledgement */
465
466 /** Initialize header
467 @param[in] version descriptor version */
469
470 /** Serialize the descriptor. Caller should pass
471 the length if allocated.
472 @param[out] desc_state serialized descriptor
473 @param[in,out] len length of serialized descriptor
474 @param[in] heap heap for allocating memory */
475 void serialize(byte *&desc_state, uint &len, mem_heap_t *heap);
476
477 /** Deserialize the descriptor.
478 @param[in] desc_state serialized descriptor
479 @param[in] desc_len descriptor length
480 @return true, if successful. */
481 bool deserialize(const byte *desc_state, uint desc_len);
482};
483
484/** Clone file information */
486 /** Set file as deleted chunk.
487 @param[in] chunk chunk number that is found deleted. */
488 inline void set_deleted_chunk(uint32_t chunk) {
489 m_begin_chunk = chunk;
490 m_end_chunk = 0;
491 m_deleted = true;
492 }
493
494 /** @return true, iff file is deleted. */
495 bool is_deleted() const { return m_deleted; }
496
497 /** @return true, iff file is deleted. */
498 bool is_renamed() const { return m_renamed; }
499
500 /** @return true, iff file is encrypted. */
502
503 /** Reset DDL state of file metadata. */
504 void reset_ddl() {
505 m_renamed = false;
506 m_deleted = false;
507 }
508
509 /* Initialize parameters. */
510 void init();
511
512 /** File size in bytes */
513 uint64_t m_file_size;
514
515 /** File allocation size on disk for sparse files. */
516 uint64_t m_alloc_size;
517
518 /** Tablespace FSP flags */
519 uint32_t m_fsp_flags;
520
521 /** File compression type */
523
524 /** If transparent compression is needed. It is derived information
525 and is not transferred. */
527
528 /* Set file metadata as deleted. */
530
531 /* Set file metadata as renamed. */
533
534 /* Contains encryption key to be transferred. */
536
537 /** File system block size. */
539
540 /** Tablespace ID for the file */
542
543 /** File index in clone data file vector */
545
546 /** Chunk number for the first chunk in file */
548
549 /** Chunk number for the last chunk in file */
551
552 /** File name length in bytes */
554
555 /** Allocation length of name buffer. */
557
558 /** File name */
559 const char *m_file_name;
560
561 /** Encryption metadata. */
563};
564
565/** CLONE_DESC_FILE_METADATA: Descriptor for file metadata */
567 /** Descriptor header */
569
570 /** Current snapshot State */
572
573 /** File metadata */
575
576 /** Initialize header
577 @param[in] version descriptor version */
579
580 /** Serialize the descriptor. Caller should pass
581 the length if allocated.
582 @param[out] desc_file serialized descriptor
583 @param[in,out] len length of serialized descriptor
584 @param[in] heap heap for allocating memory */
585 void serialize(byte *&desc_file, uint &len, mem_heap_t *heap);
586
587 /** Deserialize the descriptor.
588 @param[in] desc_file serialized descriptor
589 @param[in] desc_len descriptor length
590 @return true, if successful. */
591 bool deserialize(const byte *desc_file, uint desc_len);
592};
593
594/** CLONE_DESC_DATA: Descriptor for data */
596 /** Descriptor header */
598
599 /** Current snapshot State */
601
602 /** Task information */
604
605 /** File identifier */
606 uint32_t m_file_index;
607
608 /** Data Length */
609 uint32_t m_data_len;
610
611 /** File offset for the data */
613
614 /** Updated file size */
615 uint64_t m_file_size;
616
617 /** Initialize header
618 @param[in] version descriptor version */
620
621 /** Serialize the descriptor. Caller should pass
622 the length if allocated.
623 @param[out] desc_data serialized descriptor
624 @param[in,out] len length of serialized descriptor
625 @param[in] heap heap for allocating memory */
626 void serialize(byte *&desc_data, uint &len, mem_heap_t *heap);
627
628 /** Deserialize the descriptor.
629 @param[in] desc_data serialized descriptor
630 @param[in] desc_len descriptor length
631 @return true, if successful. */
632 bool deserialize(const byte *desc_data, uint desc_len);
633};
634
635#endif /* CLONE_DESC_INCLUDE */
uint32_t space_id_t
Tablespace identifier.
Definition: api0api.h:50
Bitmap array index operator implementation.
Definition: clone0desc.h:195
uint32_t *& m_bitmap_ref
Reference to BITMAP array.
Definition: clone0desc.h:244
Bitmap_Operator_Impl(uint32_t *&bitmap, uint32_t index)
Construct bitmap operator.
Definition: clone0desc.h:200
uint32_t m_bit_mask
Mask with current BIT set.
Definition: clone0desc.h:250
void operator=(bool bit)
Set BIT at specific index.
Definition: clone0desc.h:232
uint32_t m_map_index
Current array position.
Definition: clone0desc.h:247
Bitmap for completed chunks in current state.
Definition: clone0desc.h:189
uint32_t size_bits() const
Size of bitmap in bits.
Definition: clone0desc.h:303
void deserialize(const byte *desc_chunk, uint &len_left)
Deserialize the descriptor.
Definition: clone0desc.cc:392
size_t size() const
Size of bitmap in bytes.
Definition: clone0desc.h:299
void serialize(byte *&desc_chunk, uint &len)
Serialize the descriptor.
Definition: clone0desc.cc:327
uint32_t * reset(uint32_t max_bits, mem_heap_t *heap)
Reset bitmap with new size.
Definition: clone0desc.cc:167
size_t get_serialized_length()
Get the length of serialized data.
Definition: clone0desc.cc:295
uint32_t * m_bitmap
BITMAP buffer.
Definition: clone0desc.h:307
Bitmap_Operator_Impl operator[](uint32_t index)
Array index operator.
Definition: clone0desc.h:256
uint32_t m_bits
Total number of BITs in the MAP.
Definition: clone0desc.h:313
Chnunk_Bitmap()
Construct bitmap.
Definition: clone0desc.h:192
uint32_t get_min_unset_bit()
Get minimum BIT position that is not set.
Definition: clone0desc.cc:195
size_t capacity() const
Maximum bit capacity.
Definition: clone0desc.h:295
uint32_t get_max_set_bit()
Get maximum BIT position that is not set.
Definition: clone0desc.cc:243
size_t m_size
BITMAP buffer size: Number of 4 byte blocks.
Definition: clone0desc.h:310
static constexpr size_t KEY_LEN
Encryption key length.
Definition: os0enc.h:116
Clone_Desc_Type
Clone descriptors contain meta information needed for applying cloned data.
Definition: clone0desc.h:129
@ CLONE_DESC_MAX
Must be the last member.
Definition: clone0desc.h:146
@ CLONE_DESC_DATA
Information for a data block.
Definition: clone0desc.h:143
@ CLONE_DESC_FILE_METADATA
Metadata for a database file.
Definition: clone0desc.h:140
@ CLONE_DESC_TASK_METADATA
Metadata for a Task/Thread for clone operation.
Definition: clone0desc.h:134
@ CLONE_DESC_LOCATOR
Logical pointer to identify a clone operation.
Definition: clone0desc.h:131
@ CLONE_DESC_STATE
Information for snapshot state.
Definition: clone0desc.h:137
const uint32_t CLONE_ALIGN_DIRECT_IO
Align by 4K for O_DIRECT.
Definition: clone0desc.h:47
const int CLONE_MAX_TASKS
Maximum number of concurrent tasks for each clone.
Definition: clone0desc.h:50
const uint64_t CLONE_LOC_INVALID_ID
Invalid locator ID.
Definition: clone0desc.h:40
bool clone_validate_locator(const byte *desc_loc, uint desc_len)
Check if clone locator is valid.
Definition: clone0desc.cc:542
Snapshot_State
Snapshot state transfer during clone.
Definition: clone0desc.h:92
@ CLONE_SNAPSHOT_PAGE_COPY
Snapshot state while transferring pages.
Definition: clone0desc.h:103
@ CLONE_SNAPSHOT_REDO_COPY
Snapshot state while transferring redo.
Definition: clone0desc.h:106
@ CLONE_SNAPSHOT_DONE
Snapshot state at end after finishing transfer.
Definition: clone0desc.h:109
@ CLONE_SNAPSHOT_NONE
Invalid state.
Definition: clone0desc.h:94
@ CLONE_SNAPSHOT_INIT
Initialize state when snapshot object is created.
Definition: clone0desc.h:97
@ CLONE_SNAPSHOT_FILE_COPY
Snapshot state while transferring files.
Definition: clone0desc.h:100
const uint32_t CLONE_DESC_MAX_BASE_LEN
Maximum base length for any serialized descriptor.
Definition: clone0desc.h:44
uint choose_desc_version(const byte *ref_loc)
Choose lowest descriptor version between reference locator and currently supported version.
Definition: clone0desc.cc:52
const size_t CLONE_MAX_TRANSFER_STAGES
Total number of data transfer stages in clone.
Definition: clone0desc.h:113
std::map< uint32_t, uint32_t > Chunk_Map
Map for current block number for unfinished chunks.
Definition: clone0desc.h:186
The memory management.
The interface to the operating system file io.
required uint64 version
Definition: replication_group_member_actions.proto:40
Incomplete Chunk information.
Definition: clone0desc.h:317
uint32_t m_min_unres_chunk
Minimum chunk number that is not reserved yet.
Definition: clone0desc.h:328
size_t get_serialized_length(uint32_t num_tasks)
Get the length of serialized data.
Definition: clone0desc.cc:305
void init_chunk_nums()
Initialize Chunk number ranges.
Definition: clone0desc.h:334
void deserialize(const byte *desc_chunk, uint &len_left)
Deserialize the descriptor.
Definition: clone0desc.cc:424
void serialize(byte *desc_chunk, uint &len)
Serialize the descriptor.
Definition: clone0desc.cc:351
Chnunk_Bitmap m_reserved_chunks
Information about chunks completed.
Definition: clone0desc.h:319
uint32_t m_total_chunks
Chunks for current state.
Definition: clone0desc.h:325
uint32_t m_max_res_chunk
Maximum chunk number that is already reserved.
Definition: clone0desc.h:331
Chunk_Map m_incomplete_chunks
Information about unfinished chunks.
Definition: clone0desc.h:322
CLONE_DESC_DATA: Descriptor for data.
Definition: clone0desc.h:595
Clone_Task_Meta m_task_meta
Task information.
Definition: clone0desc.h:603
void serialize(byte *&desc_data, uint &len, mem_heap_t *heap)
Serialize the descriptor.
Definition: clone0desc.cc:1014
uint32_t m_data_len
Data Length.
Definition: clone0desc.h:609
uint32_t m_file_index
File identifier.
Definition: clone0desc.h:606
Snapshot_State m_state
Current snapshot State.
Definition: clone0desc.h:600
uint64_t m_file_offset
File offset for the data.
Definition: clone0desc.h:612
void init_header(uint version)
Initialize header.
Definition: clone0desc.cc:1006
uint64_t m_file_size
Updated file size.
Definition: clone0desc.h:615
Clone_Desc_Header m_header
Descriptor header.
Definition: clone0desc.h:597
bool deserialize(const byte *desc_data, uint desc_len)
Deserialize the descriptor.
Definition: clone0desc.cc:1041
CLONE_DESC_FILE_METADATA: Descriptor for file metadata.
Definition: clone0desc.h:566
Clone_File_Meta m_file_meta
File metadata.
Definition: clone0desc.h:574
bool deserialize(const byte *desc_file, uint desc_len)
Deserialize the descriptor.
Definition: clone0desc.cc:754
void init_header(uint version)
Initialize header.
Definition: clone0desc.cc:656
void serialize(byte *&desc_file, uint &len, mem_heap_t *heap)
Serialize the descriptor.
Definition: clone0desc.cc:670
Snapshot_State m_state
Current snapshot State.
Definition: clone0desc.h:571
Clone_Desc_Header m_header
Descriptor header.
Definition: clone0desc.h:568
Header common to all descriptors.
Definition: clone0desc.h:150
uint m_version
Descriptor version.
Definition: clone0desc.h:152
Clone_Desc_Type m_type
Descriptor type.
Definition: clone0desc.h:158
bool deserialize(const byte *desc_hdr, uint desc_len)
Deserialize the descriptor header.
Definition: clone0desc.cc:78
void serialize(byte *desc_hdr)
Serialize the descriptor header: Caller must allocate the serialized buffer.
Definition: clone0desc.cc:72
uint m_length
Serialized length of descriptor in bytes.
Definition: clone0desc.h:155
CLONE_DESC_LOCATOR: Descriptor for a task for clone operation.
Definition: clone0desc.h:361
Snapshot_State m_state
Current snapshot State.
Definition: clone0desc.h:375
bool match(Clone_Desc_Locator *other_desc)
Check if the passed locator matches the current one.
Definition: clone0desc.cc:489
void init(uint64_t id, uint64_t snap_id, Snapshot_State state, uint version, uint index)
Initialize clone locator.
Definition: clone0desc.cc:473
void serialize(byte *&desc_loc, uint &len, Chunk_Info *chunk_info, mem_heap_t *heap)
Serialize the descriptor.
Definition: clone0desc.cc:503
Clone_Desc_Header m_header
Descriptor header.
Definition: clone0desc.h:363
uint32_t m_clone_index
Index in clone array for fast reference.
Definition: clone0desc.h:372
uint64_t m_clone_id
Unique identifier for a clone operation.
Definition: clone0desc.h:366
uint64_t m_snapshot_id
Unique identifier for a clone snapshot.
Definition: clone0desc.h:369
bool m_metadata_transferred
Sub-state information: metadata transferred.
Definition: clone0desc.h:378
void deserialize(const byte *desc_loc, uint desc_len, Chunk_Info *chunk_info)
Deserialize the descriptor.
Definition: clone0desc.cc:558
CLONE_DESC_STATE: Descriptor for current snapshot state.
Definition: clone0desc.h:438
bool m_is_start
If start processing state.
Definition: clone0desc.h:461
bool deserialize(const byte *desc_state, uint desc_len)
Deserialize the descriptor.
Definition: clone0desc.cc:947
Snapshot_State m_state
Current snapshot State.
Definition: clone0desc.h:443
uint m_num_chunks
Number of chunks in current state.
Definition: clone0desc.h:449
Clone_Desc_Header m_header
Descriptor header.
Definition: clone0desc.h:440
uint m_task_index
Task identifier.
Definition: clone0desc.h:446
uint64_t m_estimate
Number of estimated bytes to transfer.
Definition: clone0desc.h:455
void init_header(uint version)
Initialize header.
Definition: clone0desc.cc:905
uint m_num_files
Number of files in current state.
Definition: clone0desc.h:452
bool m_is_ack
State transfer Acknowledgement.
Definition: clone0desc.h:464
uint64_t m_estimate_disk
Number of estimated bytes on disk.
Definition: clone0desc.h:458
void serialize(byte *&desc_state, uint &len, mem_heap_t *heap)
Serialize the descriptor.
Definition: clone0desc.cc:913
CLONE_DESC_TASK_METADATA: Descriptor for a task for clone operation.
Definition: clone0desc.h:412
Clone_Desc_Header m_header
Descriptor header.
Definition: clone0desc.h:414
void serialize(byte *&desc_task, uint &len, mem_heap_t *heap)
Serialize the descriptor.
Definition: clone0desc.cc:115
bool deserialize(const byte *desc_task, uint desc_len)
Deserialize the descriptor.
Definition: clone0desc.cc:133
void init_header(uint version)
Initialize header.
Definition: clone0desc.cc:107
Clone_Task_Meta m_task_meta
Task information.
Definition: clone0desc.h:417
Clone file information.
Definition: clone0desc.h:485
bool is_renamed() const
Definition: clone0desc.h:498
uint m_file_index
File index in clone data file vector.
Definition: clone0desc.h:544
Compression::Type m_compress_type
File compression type.
Definition: clone0desc.h:522
uint32_t m_fsp_flags
Tablespace FSP flags.
Definition: clone0desc.h:519
void reset_ddl()
Reset DDL state of file metadata.
Definition: clone0desc.h:504
void init()
Definition: clone0desc.cc:1071
bool m_transfer_encryption_key
Definition: clone0desc.h:535
size_t m_file_name_alloc_len
Allocation length of name buffer.
Definition: clone0desc.h:556
size_t m_fsblk_size
File system block size.
Definition: clone0desc.h:538
space_id_t m_space_id
Tablespace ID for the file.
Definition: clone0desc.h:541
uint64_t m_alloc_size
File allocation size on disk for sparse files.
Definition: clone0desc.h:516
bool can_encrypt() const
Definition: clone0desc.h:501
bool is_deleted() const
Definition: clone0desc.h:495
size_t m_file_name_len
File name length in bytes.
Definition: clone0desc.h:553
void set_deleted_chunk(uint32_t chunk)
Set file as deleted chunk.
Definition: clone0desc.h:488
bool m_deleted
Definition: clone0desc.h:529
bool m_punch_hole
If transparent compression is needed.
Definition: clone0desc.h:526
uint64_t m_file_size
File size in bytes.
Definition: clone0desc.h:513
const char * m_file_name
File name.
Definition: clone0desc.h:559
Encryption_metadata m_encryption_metadata
Encryption metadata.
Definition: clone0desc.h:562
uint m_end_chunk
Chunk number for the last chunk in file.
Definition: clone0desc.h:550
bool m_renamed
Definition: clone0desc.h:532
uint m_begin_chunk
Chunk number for the first chunk in file.
Definition: clone0desc.h:547
Task information in clone operation.
Definition: clone0desc.h:173
uint m_block_num
Current block number that is already transferred.
Definition: clone0desc.h:181
uint m_chunk_num
Current chunk number reserved by the task.
Definition: clone0desc.h:178
uint m_task_index
Index in task array.
Definition: clone0desc.h:175
Type
Algorithm types supported.
Definition: file.h:52
Encryption metadata.
Definition: os0enc.h:452
bool can_encrypt() const
Definition: os0enc.h:465
The info structure stored at the beginning of a heap block.
Definition: mem0mem.h:299
unsigned int uint
Definition: uca-dump.cc:29
Version control for database, common definitions, and include files.
#define ut_ad(EXPR)
Debug assertion.
Definition: ut0dbg.h:68
#define ut_a(EXPR)
Abort execution if EXPR does not evaluate to nonzero.
Definition: ut0dbg.h:56