Restore wait_for_status check
@@ -347,6 +347,18 @@ class TableIndexer:
}
}
)
+ # Cluster status will always be yellow in development environments
+ # because there will only be one node available. In production, there
+ # are many nodes, and the index should not be promoted until all
+ # shards have been initialized.
+ environment = os.getenv('ENVIRONMENT', 'local')
+ if environment != 'local':
+ log.info('Waiting for replica shards. . .')
+ es.cluster.health(
+ index=write_index,
+ wait_for_status='green',
+ timeout="3h"
+ )
# If the index exists already and it's not an alias, delete it.
if live_alias in indices:
log.warning('Live index already exists. Deleting and realiasing.')
