Skip to content

Commit 1b92e3b

Browse files
committed
Fix txn_blocked_by order
1 parent f39a966 commit 1b92e3b

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/java/org/apache/cassandra/db/virtual/AccordDebugKeyspace.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2089,7 +2089,7 @@ protected TxnBlockedByTable()
20892089
" blocked_by_txn_id 'TxnIdUtf8Type',\n" +
20902090
" save_status text,\n" +
20912091
" execute_at text,\n" +
2092-
" PRIMARY KEY (txn_id, command_store_id, depth, blocked_by_key, blocked_by_txn_id)" +
2092+
" PRIMARY KEY (txn_id, depth, command_store_id, blocked_by_txn_id, blocked_by_key)" +
20932093
')', TxnIdUtf8Type.instance), BEST_EFFORT, ASC);
20942094
}
20952095

src/java/org/apache/cassandra/service/accord/DebugBlockedTxns.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,14 @@ public int compareTo(Txn that)
9696
int c = Integer.compare(this.commandStoreId, that.commandStoreId);
9797
if (c == 0) c = Integer.compare(this.depth, that.depth);
9898
if (c == 0) c = this.txnId.compareTo(that.txnId);
99+
if (c == 0) c = this.blockedViaKeyString().compareTo(that.blockedViaKeyString());
99100
return c;
100101
}
102+
103+
private String blockedViaKeyString()
104+
{
105+
return blockedViaKey == null ? "" : blockedViaKey.toString();
106+
}
101107
}
102108

103109
final IAccordService service;

0 commit comments

Comments
 (0)