Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-5068

Support hardening/persisting the JMSRedeliveryFlag across restarts

    Details

      Description

      WMQ supports a HARDENBO[1] flag on the redelivery flag impl. Which persists before dispatch. And has a corresponding performance impact.
      So we need to implement an additional journal command to persist delivery attempts and update the counter on restart/recovery to get parity.

      This will allow the redeliverFlag to be guaranteed to flag a potential duplicate dispatch in the event of a hard broker failure just after dispatch.

      [1] http://publib.boulder.ibm.com/infocenter/wmqv7/v7r0/index.jsp?topic=%2Fcom.ibm.mq.explorer.doc%2Fe_properties_queues.htm

        Issue Links

          Activity

          Hide
          gtully Gary Tully added a comment -

          The persisting on rollback is fine when the broker stays alive or dies after a rollback or shuts down gracefully.
          But if there is no transaction, or the broker aborts (and does not get a chance to write any more) we have a problem.

          This new solution requires writing 'before' we dispatch, so if we reread the store we know it 'may be' a duplicate dispatch.

          It is about duplicate dispatch rather than duplicate delivery.

          Show
          gtully Gary Tully added a comment - The persisting on rollback is fine when the broker stays alive or dies after a rollback or shuts down gracefully. But if there is no transaction, or the broker aborts (and does not get a chance to write any more) we have a problem. This new solution requires writing 'before' we dispatch, so if we reread the store we know it 'may be' a duplicate dispatch. It is about duplicate dispatch rather than duplicate delivery.
          Hide
          gtully Gary Tully added a comment -

          Fix in http://git-wip-us.apache.org/repos/asf/activemq/commit/266d23ef

          enabled via destination policy

          <policyEntry ... persistJMSRedelivered="true" />

          This ensures that the JMSRedelivered header will always be set on a restart.
          Note: this is only done once, to preserve the redelivered flag. the redelivery count is not preserved.

          Show
          gtully Gary Tully added a comment - Fix in http://git-wip-us.apache.org/repos/asf/activemq/commit/266d23ef enabled via destination policy <policyEntry ... persistJMSRedelivered= " true " /> This ensures that the JMSRedelivered header will always be set on a restart. Note: this is only done once, to preserve the redelivered flag. the redelivery count is not preserved.
          Hide
          gtully Gary Tully added a comment -

          implemented for kahadb, leveldb and jdbc message stores.

          Show
          gtully Gary Tully added a comment - implemented for kahadb, leveldb and jdbc message stores.
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit c78eddce7ed3045b5508dd6713252dca8766436c in activemq's branch refs/heads/master from Gary Tully
          [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=c78eddc ]

          revert sync ack send for https://issues.apache.org/jira/browse/AMQ-3519 due to rework in https://issues.apache.org/jira/browse/AMQ-5068 - sync send no longer needed because redelivered flag is persisted before dispatch. This avoids a roundtrip overhead on individual ack, ie priority or nonBlockingRedelivery options in the mix

          Show
          jira-bot ASF subversion and git services added a comment - Commit c78eddce7ed3045b5508dd6713252dca8766436c in activemq's branch refs/heads/master from Gary Tully [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=c78eddc ] revert sync ack send for https://issues.apache.org/jira/browse/AMQ-3519 due to rework in https://issues.apache.org/jira/browse/AMQ-5068 - sync send no longer needed because redelivered flag is persisted before dispatch. This avoids a roundtrip overhead on individual ack, ie priority or nonBlockingRedelivery options in the mix
          Hide
          jira-bot ASF subversion and git services added a comment -

          Commit f8488916c2cc04c402e437fdbc2f61f118189d08 in activemq's branch refs/heads/activemq-5.13.x from Gary Tully
          [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=f848891 ]

          revert sync ack send for https://issues.apache.org/jira/browse/AMQ-3519 due to rework in https://issues.apache.org/jira/browse/AMQ-5068 - sync send no longer needed because redelivered flag is persisted before dispatch. This avoids a roundtrip overhead on individual ack, ie priority or nonBlockingRedelivery options in the mix

          (cherry picked from commit c78eddce7ed3045b5508dd6713252dca8766436c)

          Show
          jira-bot ASF subversion and git services added a comment - Commit f8488916c2cc04c402e437fdbc2f61f118189d08 in activemq's branch refs/heads/activemq-5.13.x from Gary Tully [ https://git-wip-us.apache.org/repos/asf?p=activemq.git;h=f848891 ] revert sync ack send for https://issues.apache.org/jira/browse/AMQ-3519 due to rework in https://issues.apache.org/jira/browse/AMQ-5068 - sync send no longer needed because redelivered flag is persisted before dispatch. This avoids a roundtrip overhead on individual ack, ie priority or nonBlockingRedelivery options in the mix (cherry picked from commit c78eddce7ed3045b5508dd6713252dca8766436c)

            People

            • Assignee:
              gtully Gary Tully
              Reporter:
              gtully Gary Tully
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development