MySQL Shell 9.0  /  MySQL InnoDB ReplicaSet  /  Rescanning a ReplicaSet

9.13 Rescanning a ReplicaSet

This section describes how to check a ReplicaSet for consistency using replicaSet.rescan().

replicaSet.rescan() operation does the following:

  • Ensures the replication accounts of each member are stored in the metadata.

    Note

    replicaSet.status() also checks for missing replication users and prompts you to run replicaSet.rescan() to add any missing accounts to the metadata.

  • Checks for unmanaged members and adds them if configured to do so. Unmanaged members are instances which are part of the ReplicaSet but are not present in the metadata.

  • Checks for obsolete members and removes them if configured to do so. Obsolete members are instances which are not part of the ReplicaSet but are present in the metadata. Invalidated instances are ignored.

  • Ensures the values of server_id and server_uuid are stored in the metadata for each member of the ReplicaSet.

Adding Unmanaged Instances

replicaSet.rescan() can be configured to add unmanaged instances by setting the option addUnmanaged to true. By default, this option is set to false and lists all unmanaged instances, but makes no changes to the ReplicaSet.

If replicaSet.rescan() is run in interactive mode, the unmanaged instances are listed and you are prompted to add them to the ReplicaSet.

Removing Obsolete Instances

replicaSet.rescan() can be configured to remove obsolete instances by setting the option removeObsolete to true. By default, this option is set to false and lists all obsolete instances, but makes no changes to the ReplicaSet.

If replicaSet.rescan() is run in interactive mode, the obsolete instances are listed and you are prompted to remove them.