Home / Databricks on Azure

Databricks on AzureRunbookAdvanced

Sev1: a bad model version is live on a Databricks Model Serving endpoint. Roll back traffic in minutes

A new model version on a production serving endpoint returns errors or wrong predictions. Shift traffic back to the last good version, stop automation from redeploying it, and use inference tables to size the impact.

Deepak Bhardwaj6 min read

Applies toAzure Databricks Mosaic AI Model Serving custom model endpoints, MLflow models in Unity Catalog with aliases, Databricks CLI 0.2xx, inference tables

Symptoms

  • An application calling a serving endpoint starts getting HTTP 4xx/5xx, schema errors or timeouts right after a deployment.
  • Or the calls succeed but predictions are clearly wrong: scores all near 0 or 1, a class that never appears, prices off by a factor.
  • Latency jumps because the new version is larger or loads extra dependencies.
  • The endpoint config shows a new entity_version that went live in the last hours, often deployed by a CI job or a deployment job that follows a model alias such as @champion.

The fastest fix is almost always to send 100% of traffic back to the previous version, then investigate. Model Serving keeps the current config serving until a new config is ready, so a rollback is a normal config update with no downtime.

Step 1: see what is live (2 minutes)

databricks serving-endpoints get fraud-scoring -o json | jq '{
  state: .state,
  served: [.config.served_entities[] | {name, entity_name, entity_version, workload_size, scale_to_zero_enabled}],
  traffic: .config.traffic_config.routes,
  pending: (.pending_config.served_entities // [] | map({name, entity_version}))
}'
What you see Meaning
One served entity at the new version, 100% traffic Full rollout; roll back with step 2a
Old and new versions both served, traffic split Canary; shift traffic with step 2b
pending_config present, state.config_update = IN_PROGRESS An update is still deploying; wait for it to finish or fail before you send another

Check the model's versions and aliases in Unity Catalog:

from mlflow import MlflowClient
import mlflow
mlflow.set_registry_uri("databricks-uc")
c = MlflowClient()

name = "ml_prod.fraud.fraud_model"
for v in c.search_model_versions(f"name='{name}'"):
    print(v.version, v.aliases, v.creation_timestamp, v.run_id)

The last good version is normally the one that was live before the change; confirm it in the endpoint's event history in the Serving UI or in your deployment logs.

Step 2a: roll back a full rollout

Send a config with the previous version only. update-config replaces the whole served entity list, so include every field you need (size, scale to zero, environment variables):

databricks serving-endpoints update-config fraud-scoring --json '{
  "served_entities": [{
    "name": "fraud_model-12",
    "entity_name": "ml_prod.fraud.fraud_model",
    "entity_version": "12",
    "workload_size": "Medium",
    "scale_to_zero_enabled": false
  }],
  "traffic_config": {
    "routes": [{"served_model_name": "fraud_model-12", "traffic_percentage": 100}]
  }
}'

Warning

Copy environment_vars, instance_profile_arn-style settings and any secrets references ({{secrets/scope/key}}) from the current config into the rollback config. Leaving them out removes them, and the old version may then fail to start.

The old version has to be built and provisioned again if it is no longer served. That takes minutes, longer for large models or GPU workloads; the new (bad) version keeps serving until it is ready. If the bad version is causing real harm (wrong decisions being made), ask the application team to switch to their fallback path while you wait.

Step 2b: shift traffic in a canary

If the old version is still a served entity, change only the routes. This is the fastest rollback because nothing needs to be rebuilt:

databricks serving-endpoints update-config fraud-scoring --json '{
  "served_entities": [
    {"name": "fraud_model-12", "entity_name": "ml_prod.fraud.fraud_model", "entity_version": "12", "workload_size": "Medium", "scale_to_zero_enabled": false},
    {"name": "fraud_model-13", "entity_name": "ml_prod.fraud.fraud_model", "entity_version": "13", "workload_size": "Small",  "scale_to_zero_enabled": true}
  ],
  "traffic_config": {
    "routes": [
      {"served_model_name": "fraud_model-12", "traffic_percentage": 100},
      {"served_model_name": "fraud_model-13", "traffic_percentage": 0}
    ]
  }
}'

Keep version 13 at 0% so you can reproduce the problem against it without customer traffic.

Step 3: stop the redeploy

If a deployment job or CI pipeline deploys whatever version carries an alias, it will roll forward again on its next run. Move the alias back and pause the automation:

c.set_registered_model_alias(name, "champion", "12")
c.set_registered_model_alias(name, "rejected", "13")   # optional, for the record
databricks jobs list --name "deploy-fraud-model" -o json | jq '.[].job_id'
# pause its schedule or trigger in the UI, or set pause_status to PAUSED with jobs update

Step 4: confirm the rollback

databricks serving-endpoints get fraud-scoring -o json \
  | jq '{ready: .state.ready, update: .state.config_update, live: [.config.served_entities[] | .entity_version]}'

databricks serving-endpoints query fraud-scoring --json '{
  "dataframe_records": [{"amount": 120.5, "merchant_category": "5411", "country": "GB"}]
}'
  • state.ready is READY and config_update is NOT_UPDATING.
  • A known test record returns the expected prediction.
  • The application's error rate and latency are back to baseline.

If the old version fails to start, read its logs:

databricks serving-endpoints build-logs fraud-scoring fraud_model-12
databricks serving-endpoints logs fraud-scoring fraud_model-12

Step 5: size the impact

If inference tables are enabled, every request and response is logged to a Unity Catalog table. Column names differ between legacy and AI Gateway inference tables; check yours with DESCRIBE TABLE.

SELECT date_trunc('HOUR', request_time) AS hour,
       served_entity_id,
       count(*) AS requests,
       count_if(status_code >= 400) AS errors,
       percentile(execution_duration_ms, 0.95) AS p95_ms
FROM ml_prod.fraud.fraud_scoring_payload
WHERE request_time >= '2026-11-16T06:00:00'
GROUP BY ALL
ORDER BY hour;

Give the application owners the exact window and the request IDs served by the bad version. They decide whether past decisions need to be re-scored or reviewed. For a fraud, credit or pricing model, that can be a business or compliance issue, not only a technical one.

Find the root cause

Symptom on the bad version Likely cause
400 errors about missing or extra columns Model signature changed; clients still send the old schema
Wrong but valid predictions Training data or feature pipeline changed; label leakage; wrong preprocessing artifact logged
Start-up failures, import errors Dependency versions in the logged environment differ from training
Higher latency, OOM Larger model or batch size; workload size not changed to match

Reproduce against the 0% served entity or in a notebook with mlflow.pyfunc.load_model(f"models:/{name}/13").

Prevent it next time

  • Roll out new versions as a canary (5–10% traffic) with automatic checks on error rate and prediction distribution before moving to 100%.
  • Keep the previous version as a served entity at 0% for a day after a full rollout, so rollback is a routes-only change.
  • Gate promotion of the @champion alias on an evaluation job against a fixed holdout set and on schema compatibility checks.
  • Keep endpoint configs in Asset Bundles or Terraform; restrict CAN MANAGE on production endpoints to the deployment service principal.
  • Enable inference tables and a monitor on prediction drift so wrong-but-successful responses are caught by alerts, not by customers.