| 1 |
# |
| 2 |
# Detect and sync all metadata mismatches between NDB Dictionary and DD |
| 3 |
# |
| 4 |
# Arguments: |
| 5 |
# max_wait - number of seconds to wait before timing out |
| 6 |
# |
| 7 |
|
| 8 |
# Trigger immediate synchronization |
| 9 |
SET GLOBAL ndb_metadata_sync = true; |
| 10 |
|
| 11 |
# Wait for synchronization to complete |
| 12 |
let $metadata_sync_value = `SELECT @@ndb_metadata_sync`; |
| 13 |
expr $max_wait_intervals = $max_wait + $max_wait; |
| 14 |
while ($metadata_sync_value != 0) |
| 15 |
{ |
| 16 |
sleep 0.5; |
| 17 |
dec $max_wait_intervals; |
| 18 |
if ($max_wait_intervals == 0) |
| 19 |
{ |
| 20 |
die Timed out waiting for metadata changes to be synced; |
| 21 |
} |
| 22 |
let $metadata_sync_value = `SELECT @@ndb_metadata_sync`; |
| 23 |
} |