Github user jbertram commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/872#discussion_r85810957
  
    --- Diff: 
artemis-journal/src/main/java/org/apache/activemq/artemis/core/journal/impl/JournalImpl.java
 ---
    @@ -724,94 +731,86 @@ public void appendUpdateRecord(final long id,
                                       final boolean sync,
                                       final IOCompletion callback) throws 
Exception {
           checkJournalIsLoaded();
    +      lineUpContext(callback);
    +      checkKnownRecordID(id);
     
    -      journalLock.readLock().lock();
    +      Future<?> result = appendExecutor.submit(new Runnable() {
    +         @Override
    +         public void run() {
    +            journalLock.readLock().lock();
    +            try {
    +               JournalRecord jrnRecord = records.get(id);
    +               JournalInternalRecord updateRecord = new 
JournalAddRecord(false, id, recordType, record);
    +               JournalFile usedFile = appendRecord(updateRecord, false, 
sync, null, callback);
     
    -      try {
    -         JournalRecord jrnRecord = records.get(id);
    +               if (logger.isTraceEnabled()) {
    +                  logger.trace("appendUpdateRecord::id=" + id +
    +                                  ", userRecordType=" +
    +                                  recordType +
    +                                  ", usedFile = " +
    +                                  usedFile);
    +               }
     
    -         if (jrnRecord == null) {
    -            if (!(compactor != null && compactor.lookupRecord(id))) {
    -               throw new IllegalStateException("Cannot find add info " + 
id);
    +               // record==null here could only mean there is a compactor
    +               // computing the delete should be done after compacting is 
done
    +               if (jrnRecord == null) {
    +                  compactor.addCommandUpdate(id, usedFile, 
updateRecord.getEncodeSize());
    +               } else {
    +                  jrnRecord.addUpdateFile(usedFile, 
updateRecord.getEncodeSize());
    +               }
    +            } catch (Exception e) {
    +               ActiveMQJournalLogger.LOGGER.error(e.getMessage(), e);
    --- End diff --
    
    Same here as above.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to