Skip to content

Commit

Permalink
Backport to branch(3.12) : Revise error messages (#1591)
Browse files Browse the repository at this point in the history
Co-authored-by: Toshihiro Suzuki <[email protected]>
  • Loading branch information
feeblefakie and brfrn169 authored Mar 6, 2024
1 parent b01ed3e commit 1631fbd
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public abstract class ActiveTransactionManagedDistributedTransactionManager
try {
t.rollback();
} catch (Exception e) {
logger.warn("Rollback failed. transaction ID: {}", id, e);
logger.warn("Rollback failed. Transaction ID: {}", id, e);
}
});

Expand All @@ -53,7 +53,7 @@ public ActiveTransactionManagedDistributedTransactionManager(DatabaseConfig conf
config.getActiveTransactionManagementExpirationTimeMillis(),
TRANSACTION_EXPIRATION_INTERVAL_MILLIS,
(id, t) -> {
logger.warn("The transaction is expired. transaction ID: {}", id);
logger.warn("The transaction is expired. Transaction ID: {}", id);
transactionExpirationHandler.get().accept(id, t);
});
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public abstract class ActiveTransactionManagedTwoPhaseCommitTransactionManager
try {
t.rollback();
} catch (Exception e) {
logger.warn("Rollback failed. transaction ID: {}", id, e);
logger.warn("Rollback failed. Transaction ID: {}", id, e);
}
});

Expand All @@ -55,7 +55,7 @@ public ActiveTransactionManagedTwoPhaseCommitTransactionManager(DatabaseConfig c
config.getActiveTransactionManagementExpirationTimeMillis(),
TRANSACTION_EXPIRATION_INTERVAL_MILLIS,
(id, t) -> {
logger.warn("The transaction is expired. transaction ID: {}", id);
logger.warn("The transaction is expired. Transaction ID: {}", id);
transactionExpirationHandler.get().accept(id, t);
});
}
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/com/scalar/db/common/error/CoreError.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public enum CoreError implements ScalarDbError {
"The LIKE pattern must not end with an escape character",
"",
""),
COLUMN_NOT_FOUND(Category.USER_ERROR, "0030", "Column %s does not exist", "", ""),
COLUMN_NOT_FOUND(Category.USER_ERROR, "0030", "The column %s does not exist", "", ""),
GET_BUILD_ERROR_OPERATION_NOT_SUPPORTED_WHEN_GETTING_RECORDS_OF_DATABASE_WITHOUT_USING_INDEX(
Category.USER_ERROR,
"0031",
Expand Down Expand Up @@ -458,7 +458,7 @@ public enum CoreError implements ScalarDbError {
"",
""),
CONSENSUS_COMMIT_COLUMN_RESERVED_AS_TRANSACTION_METADATA(
Category.USER_ERROR, "0101", "Column '%s' is reserved as transaction metadata", "", ""),
Category.USER_ERROR, "0101", "The column '%s' is reserved as transaction metadata", "", ""),
CONSENSUS_COMMIT_BEFORE_PREFIXED_COLUMN_FOR_NON_PRIMARY_KEY_RESERVED_AS_TRANSACTION_METADATA(
Category.USER_ERROR,
"0102",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ public void commitRecords(Snapshot snapshot) {
}
parallelExecutor.commitRecords(tasks, snapshot.getId());
} catch (Exception e) {
logger.warn("Committing records failed. transaction ID: {}", snapshot.getId(), e);
logger.warn("Committing records failed. Transaction ID: {}", snapshot.getId(), e);
// ignore since records are recovered lazily
}
}
Expand Down Expand Up @@ -213,7 +213,7 @@ public void rollbackRecords(Snapshot snapshot) {
}
parallelExecutor.rollbackRecords(tasks, snapshot.getId());
} catch (Exception e) {
logger.warn("Rolling back records failed. transaction ID: {}", snapshot.getId(), e);
logger.warn("Rolling back records failed. Transaction ID: {}", snapshot.getId(), e);
// ignore since records are recovered lazily
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ private void executeTasksInParallel(
t.run();
} catch (Exception e) {
logger.warn(
"Failed to run a {} task. transaction ID: {}", taskName, transactionId, e);
"Failed to run a {} task. Transaction ID: {}", taskName, transactionId, e);
throw e;
}
return null;
Expand Down Expand Up @@ -243,7 +243,7 @@ private void executeTasksSerially(
try {
task.run();
} catch (ExecutionException | ValidationConflictException | CrudException e) {
logger.warn("Failed to run a {} task. transaction ID: {}", taskName, transactionId, e);
logger.warn("Failed to run a {} task. Transaction ID: {}", taskName, transactionId, e);

if (!stopOnError) {
exception = e;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public void recover(Selection selection, TransactionResult result) {
try {
state = coordinator.getState(result.getId());
} catch (CoordinatorException e) {
logger.warn("Can't get coordinator state. transaction ID: {}", result.getId(), e);
logger.warn("Can't get coordinator state. Transaction ID: {}", result.getId(), e);
return;
}

Expand Down Expand Up @@ -69,7 +69,7 @@ void rollbackRecord(Selection selection, TransactionResult result) {
composer.add(selection, result);
mutate(composer.get(), result.getId());
} catch (Exception e) {
logger.warn("Rolling back a record failed. transaction ID: {}", result.getId(), e);
logger.warn("Rolling back a record failed. Transaction ID: {}", result.getId(), e);
// ignore since the record is recovered lazily
}
}
Expand Down Expand Up @@ -108,7 +108,7 @@ private void mutate(List<Mutation> mutations, String transactionId) {
storage.mutate(mutations);
} catch (ExecutionException e) {
logger.warn(
"Mutation in recovery failed. the record will be eventually recovered. transaction ID: {}",
"Mutation in recovery failed. the record will be eventually recovered. Transaction ID: {}",
transactionId,
e);
}
Expand Down

0 comments on commit 1631fbd

Please sign in to comment.