• Dmitry Kazakov's avatar
    Fix ConcurrentMap::migrationInProcess() to handle initialization value (0) properly · 2ffdc5b0
    Dmitry Kazakov authored
    Job coordinator of the table may have three states:
    1) jobCoordinator == 0: the table was initialized, but no migration
       has ever been started for this table
    2) jobCoordinator > 1: a table migration is in progress right now. The
       caller should join *jobCoordinator to help finishing the migration.
    3) jobCoordinator == 1: the table migration has been finished. It means
       that the table doesn't have any values in it anymore.
    The patch actually fixes the map to consider case 1 as a situation, when
    there is no migration.
concurrent_map.h 13.3 KB