Skip to content

Commit

Permalink
[computes] removed admissiond from impala readiness check
Browse files Browse the repository at this point in the history
admissiond check is no longer needed.
also fixed a few other bool conversions.

the `is_ready` field currently has minimal effect on the UI. We return
the results sorting the computes with ready ones on the top while
non-ready ones at the bottom. In future, we should update the UI to
indicate if a compute is ready to accept queries or not.

This change also makes the compute.is_ready nullable/optional because
it is not in full use yet and should not effect inserts and updates.
  • Loading branch information
amitsrivastava committed Jan 22, 2025
1 parent 1673b1f commit d610479
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
18 changes: 18 additions & 0 deletions apps/beeswax/src/beeswax/migrations/0004_alter_compute_is_ready.py
Original file line number Diff line number Diff line change
@@ -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),
),
]
2 changes: 1 addition & 1 deletion apps/beeswax/src/beeswax/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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='{}')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down

0 comments on commit d610479

Please sign in to comment.