activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jbertram <...@git.apache.org>
Subject [GitHub] activemq-artemis pull request #872: A few fixes before the release around jo...
Date Mon, 31 Oct 2016 19:09:23 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message