add additional information on quorum failure message
@@ -154,7 +154,6 @@ public class ONewDistributedTransactionManager {
ORID id = ((OTxUniqueIndex) resultPayload).getRecordId();
String index = ((OTxUniqueIndex) resultPayload).getIndex();
Object key = ((OTxUniqueIndex) resultPayload).getKey();
- //TODO include all paramenter in response
throw new ORecordDuplicatedException(
String.format("Cannot index record %s: found duplicated key '%s' in index '%s' ", id, key, index), index, id, key);
}
@@ -174,16 +173,33 @@ public class ONewDistributedTransactionManager {
} else {
List<OTransactionResultPayload> results = responseManager.getAllResponses();
//If quorum is not reached is enough on a Lock timeout to trigger a deadlock retry.
+ List<String> messages = new ArrayList<>();
for (OTransactionResultPayload result : results) {
switch (result.getResponseType()) {
case OTxLockTimeout.ID:
sendPhase2Task(involvedClusters, nodes, new OTransactionPhase2Task(requestId, false, involvedClustersIds, getLsn()));
throw new ODistributedRecordLockedException("DeadLock", new ORecordId(-1, -1), requestId, 0);
+ case OTxSuccess.ID:
+ messages.add("success");
+ break;
+ case OTxConcurrentModification.ID:
+ messages.add(String.format("concurrent modification record: %s database version: %i",
+ ((OTxConcurrentModification) result).getRecordId().toString(), ((OTxConcurrentModification) result).getVersion()));
+ break;
+ case OTxException.ID:
+ messages.add(String.format("exception: '$s'", ((OTxException) result).getException().getMessage()));
+ break;
+ case OTxUniqueIndex.ID:
+ messages.add(String
+ .format("unique index violation on index:'$s' with key:'%s' and rid:'%s'", ((OTxUniqueIndex) result).getIndex(),
+ ((OTxUniqueIndex) result).getKey(), ((OTxUniqueIndex) result).getRecordId()));
+ break;
+
}
}
localKo(requestId, database);
sendPhase2Task(involvedClusters, nodes, new OTransactionPhase2Task(requestId, false, involvedClustersIds, getLsn()));
- throw new ODistributedOperationException("quorum not reached");
+ throw new ODistributedOperationException(String.format("quorum not reached, responses: [%s]", String.join(",", messages)));
}
}
