@@ -1380,52 +1380,65 @@ fil_crypt_return_iops(
1380
1380
fil_crypt_update_total_stat (state);
1381
1381
}
1382
1382
1383
- /* * Return the next tablespace from rotation_list .
1383
+ /* * Return the next tablespace from default_encrypt_tables .
1384
1384
@param space previous tablespace (NULL to start from the start)
1385
1385
@param recheck whether the removal condition needs to be rechecked after
1386
1386
the encryption parameters were changed
1387
1387
@param encrypt expected state of innodb_encrypt_tables
1388
1388
@return the next tablespace to process (n_pending_ops incremented)
1389
1389
@retval NULL if this was the last */
1390
- inline fil_space_t *fil_system_t ::keyrotate_next( fil_space_t *space,
1391
- bool recheck, bool encrypt)
1390
+ inline fil_space_t *fil_system_t ::default_encrypt_next(
1391
+ fil_space_t *space, bool recheck, bool encrypt)
1392
1392
{
1393
1393
ut_ad (mutex_own (&mutex));
1394
1394
1395
1395
sized_ilist<fil_space_t , rotation_list_tag_t >::iterator it=
1396
- space && space->is_in_rotation_list ? space : rotation_list.begin ();
1396
+ space && space->is_in_default_encrypt
1397
+ ? space
1398
+ : default_encrypt_tables.begin ();
1397
1399
const sized_ilist<fil_space_t , rotation_list_tag_t >::iterator end=
1398
- rotation_list .end ();
1400
+ default_encrypt_tables .end ();
1399
1401
1400
1402
if (space)
1401
1403
{
1402
1404
const bool released= !--space->n_pending_ops ;
1403
1405
1404
- if (space->is_in_rotation_list )
1406
+ if (space->is_in_default_encrypt )
1405
1407
{
1406
1408
while (++it != end &&
1407
1409
(!UT_LIST_GET_LEN (it->chain ) || it->is_stopping ()));
1408
1410
1409
- /* If one of the encryption threads already started the encryption
1410
- of the table then don't remove the unencrypted spaces from rotation list
1411
+ /* If one of the encryption threads already started
1412
+ the encryption of the table then don't remove the
1413
+ unencrypted spaces from default encrypt list.
1411
1414
1412
- If there is a change in innodb_encrypt_tables variables value then
1413
- don't remove the last processed tablespace from the rotation list. */
1415
+ If there is a change in innodb_encrypt_tables variables
1416
+ value then don't remove the last processed tablespace
1417
+ from the default encrypt list. */
1414
1418
if (released && (!recheck || space->crypt_data ) &&
1415
1419
!encrypt == !srv_encrypt_tables)
1416
1420
{
1417
- ut_a (!rotation_list .empty ());
1418
- rotation_list .remove (*space);
1419
- space->is_in_rotation_list = false ;
1421
+ ut_a (!default_encrypt_tables .empty ());
1422
+ default_encrypt_tables .remove (*space);
1423
+ space->is_in_default_encrypt = false ;
1420
1424
}
1421
1425
}
1422
1426
}
1427
+ else while (it != end &&
1428
+ (!UT_LIST_GET_LEN (it->chain ) || it->is_stopping ()))
1429
+ {
1430
+ /* Find the next suitable default encrypt table if
1431
+ beginning of default_encrypt_tables list has been scheduled
1432
+ to be deleted */
1433
+ it++;
1434
+ }
1423
1435
1424
1436
if (it == end)
1425
1437
return NULL ;
1426
1438
1427
1439
space= &*it;
1428
1440
space->n_pending_ops ++;
1441
+ ut_ad (!space->is_stopping ());
1429
1442
return space;
1430
1443
}
1431
1444
@@ -1443,7 +1456,7 @@ static fil_space_t *fil_space_next(fil_space_t *space, bool recheck,
1443
1456
ut_ad (!space || space->n_pending_ops );
1444
1457
1445
1458
if (!srv_fil_crypt_rotate_key_age)
1446
- space= fil_system->keyrotate_next (space, recheck, encrypt);
1459
+ space= fil_system->default_encrypt_next (space, recheck, encrypt);
1447
1460
else if (!space)
1448
1461
{
1449
1462
space= UT_LIST_GET_FIRST (fil_system->space_list );
@@ -2335,17 +2348,17 @@ fil_crypt_set_thread_cnt(
2335
2348
}
2336
2349
}
2337
2350
2338
- /* * Initialize the tablespace rotation_list
2351
+ /* * Initialize the tablespace default_encrypt_tables
2339
2352
if innodb_encryption_rotate_key_age=0. */
2340
- static void fil_crypt_rotation_list_fill ()
2353
+ static void fil_crypt_default_encrypt_tables_fill ()
2341
2354
{
2342
2355
ut_ad (mutex_own (&fil_system->mutex ));
2343
2356
2344
2357
for (fil_space_t * space = UT_LIST_GET_FIRST (fil_system->space_list );
2345
2358
space != NULL ;
2346
2359
space = UT_LIST_GET_NEXT (space_list, space)) {
2347
2360
if (space->purpose != FIL_TYPE_TABLESPACE
2348
- || space->is_in_rotation_list
2361
+ || space->is_in_default_encrypt
2349
2362
|| space->is_stopping ()
2350
2363
|| UT_LIST_GET_LEN (space->chain ) == 0 ) {
2351
2364
continue ;
@@ -2389,8 +2402,8 @@ static void fil_crypt_rotation_list_fill()
2389
2402
}
2390
2403
}
2391
2404
2392
- fil_system->rotation_list .push_back (*space);
2393
- space->is_in_rotation_list = true ;
2405
+ fil_system->default_encrypt_tables .push_back (*space);
2406
+ space->is_in_default_encrypt = true ;
2394
2407
}
2395
2408
}
2396
2409
@@ -2405,7 +2418,7 @@ fil_crypt_set_rotate_key_age(
2405
2418
mutex_enter (&fil_system->mutex );
2406
2419
srv_fil_crypt_rotate_key_age = val;
2407
2420
if (val == 0 ) {
2408
- fil_crypt_rotation_list_fill ();
2421
+ fil_crypt_default_encrypt_tables_fill ();
2409
2422
}
2410
2423
mutex_exit (&fil_system->mutex );
2411
2424
os_event_set (fil_crypt_threads_event);
@@ -2436,7 +2449,7 @@ fil_crypt_set_encrypt_tables(
2436
2449
srv_encrypt_tables = val;
2437
2450
2438
2451
if (srv_fil_crypt_rotate_key_age == 0 ) {
2439
- fil_crypt_rotation_list_fill ();
2452
+ fil_crypt_default_encrypt_tables_fill ();
2440
2453
}
2441
2454
2442
2455
mutex_exit (&fil_system->mutex );
0 commit comments