From 146948210dd03e97d06c329c7c63cc125516a18a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Hegerfors?= Date: Tue, 9 May 2017 14:44:42 +0200 Subject: [PATCH] Bump aborted runs down in cluster run summary Null fields put old aborted runs high in the sort order for repair runs history of a cluster. This moves those down to an appropriate position. --- .../spotify/reaper/storage/postgresql/IStoragePostgreSQL.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/spotify/reaper/storage/postgresql/IStoragePostgreSQL.java b/src/main/java/com/spotify/reaper/storage/postgresql/IStoragePostgreSQL.java index ad1a6ae71..1292edb20 100644 --- a/src/main/java/com/spotify/reaper/storage/postgresql/IStoragePostgreSQL.java +++ b/src/main/java/com/spotify/reaper/storage/postgresql/IStoragePostgreSQL.java @@ -203,7 +203,7 @@ public interface IStoragePostgreSQL { + "FROM repair_run " + "JOIN repair_unit ON repair_unit_id = repair_unit.id " + "WHERE repair_unit.cluster_name = :clusterName " - + "ORDER BY end_time DESC, start_time DESC " + + "ORDER BY COALESCE(end_time, start_time) DESC, start_time DESC " + "LIMIT :limit"; static final String SQL_CLUSTER_SCHEDULE_OVERVIEW =