clebertsuconic commented on a change in pull request #3889:
URL: https://github.com/apache/activemq-artemis/pull/3889#discussion_r774008804
##########
File path:
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java
##########
@@ -1161,20 +1162,27 @@ public void run() {
@Override
public void appendDeleteRecord(final long id, final boolean sync, final
IOCompletion callback) throws Exception {
-
if (logger.isTraceEnabled()) {
logger.trace("scheduling appendDeleteRecord::id=" + id);
}
-
-
checkJournalIsLoaded();
lineUpContext(callback);
- SimpleFuture<Boolean> future = new SimpleFutureImpl<>();
- internalAppendDeleteRecord(id, sync, (t, v) -> future.set(v), callback);
- if (!future.get()) {
- throw new IllegalStateException("Cannot find add info " + id);
+ final SimpleFuture<Boolean> onFoundAddInfo;
+ if (!sync && (callback == null || callback ==
DummyCallback.getInstance())) {
+ onFoundAddInfo = null;
+ } else {
+ onFoundAddInfo = new SimpleFutureImpl<>();
+ }
+ if (onFoundAddInfo == null) {
+ internalAppendDeleteRecord(id, false, null, callback);
+ } else {
+ internalAppendDeleteRecord(id, sync, (record, result) ->
onFoundAddInfo.set(result), callback);
+ }
+ if (onFoundAddInfo != null) {
+ if (!onFoundAddInfo.get()) {
Review comment:
I'm thinking we should just stop doing that.. just always log, like we
do on updates...
The only outcome from the IllegalStateException would be log.warn in most
cases.. especially on delete.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]