diff --git a/apps/beeswax/src/beeswax/migrations/0004_alter_compute_is_ready.py b/apps/beeswax/src/beeswax/migrations/0004_alter_compute_is_ready.py new file mode 100644 index 00000000000..56557da1a43 --- /dev/null +++ b/apps/beeswax/src/beeswax/migrations/0004_alter_compute_is_ready.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.25 on 2025-01-09 11:39 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('beeswax', '0003_compute_namespace'), + ] + + operations = [ + migrations.AlterField( + model_name='compute', + name='is_ready', + field=models.BooleanField(default=True, null=True), + ), + ] diff --git a/apps/beeswax/src/beeswax/models.py b/apps/beeswax/src/beeswax/models.py index 85f9e361d9b..8ae85d651ff 100644 --- a/apps/beeswax/src/beeswax/models.py +++ b/apps/beeswax/src/beeswax/models.py @@ -651,7 +651,7 @@ class Compute(models.Model): default='sqlalchemy' ) namespace = models.ForeignKey(Namespace, on_delete=models.CASCADE, null=True) - is_ready = models.BooleanField(default=True) + is_ready = models.BooleanField(default=True, null=True) external_id = models.CharField(max_length=255, null=True, db_index=True) ldap_groups_json = models.TextField(default='[]') settings = models.TextField(default='{}') diff --git a/desktop/core/src/desktop/management/commands/sync_warehouses.py b/desktop/core/src/desktop/management/commands/sync_warehouses.py index 76006ce1820..2990ab42392 100644 --- a/desktop/core/src/desktop/management/commands/sync_warehouses.py +++ b/desktop/core/src/desktop/management/commands/sync_warehouses.py @@ -170,12 +170,10 @@ def populate_impala(namespace, impala): catalogd_dep = next((d for d in deployments if d.metadata.labels['app'] == 'catalogd'), None) catalogd_stfs = next((s for s in stfs if s.metadata.labels['app'] == 'catalogd'), None) statestore_dep = next((d for d in deployments if d.metadata.labels['app'] == 'statestored'), None) - admissiond_dep = next((d for d in deployments if d.metadata.labels['app'] == 'admissiond'), None) impala['is_ready'] = bool(((catalogd_dep and catalogd_dep.status.ready_replicas) or ( catalogd_stfs and catalogd_stfs.status.ready_replicas)) - and (statestore_dep and statestore_dep.status.ready_replicas) - and (admissiond_dep and admissiond_dep.status.ready_replicas)) + and (statestore_dep and statestore_dep.status.ready_replicas)) if not impala['is_ready']: LOG.info("Impala %s not ready" % namespace) @@ -187,12 +185,12 @@ def populate_impala(namespace, impala): update_impala_configs(namespace, impala, 'impala-proxy.%s.svc.cluster.local' % namespace) else: coordinator = next((s for s in stfs if s.metadata.labels['app'] == 'coordinator'), None) - impala['is_ready'] = impala['is_ready'] and (coordinator and coordinator.status.ready_replicas) + impala['is_ready'] = bool(impala['is_ready'] and (coordinator and coordinator.status.ready_replicas)) hs2_stfs = next((s for s in stfs if s.metadata.labels['app'] == 'hiveserver2'), None) if hs2_stfs: # Impala is running with UA - impala['is_ready'] = impala['is_ready'] and hs2_stfs.status.ready_replicas + impala['is_ready'] = bool(impala['is_ready'] and hs2_stfs.status.ready_replicas) update_hive_configs(namespace, impala, 'hiveserver2-service.%s.svc.cluster.local' % namespace) else: # Impala is not running with UA