[ 
https://issues.apache.org/jira/browse/ARTEMIS-5001?focusedWorklogId=931764&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-931764
 ]

ASF GitHub Bot logged work on ARTEMIS-5001:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 26/Aug/24 16:08
            Start Date: 26/Aug/24 16:08
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on code in PR #5164:
URL: https://github.com/apache/activemq-artemis/pull/5164#discussion_r1731472715


##########
artemis-server/src/main/java/org/apache/activemq/artemis/core/persistence/impl/journal/OperationContextImpl.java:
##########
@@ -201,56 +193,80 @@ public synchronized void replicationDone() {
 
    @Override
    public void executeOnCompletion(IOCallback runnable) {
-      executeOnCompletion(runnable, false);
+      executeOnCompletion(runnable, OperationConsistencyLevel.full);
    }
 
    @Override
-   public void executeOnCompletion(final IOCallback completion, final boolean 
storeOnly) {
+   public void executeOnCompletion(final IOCallback completion, final 
OperationConsistencyLevel consistencyLevel) {
       boolean executeNow = false;
 
       synchronized (this) {
          if (errorCode == -1) {
             final long storeLined = STORE_LINEUP_UPDATER.get(this);
             final long pageLined = PAGE_LINEUP_UPDATER.get(this);
             final long replicationLined = REPLICATION_LINEUP_UPDATER.get(this);
-            if (storeOnly) {
-               if (storeOnlyTasks == null) {
-                  storeOnlyTasks = new LinkedList<>();
-               }
-            } else {
-               if (tasks == null) {
-                  tasks = new LinkedList<>();
-                  minimalReplicated = replicationLined;
-                  minimalStore = storeLined;
-                  minimalPage = pageLined;
-               }
-            }
-            // On this case, we can just execute the context directly
-
-            if (replicationLined == replicated && storeLined == stored && 
pageLined == paged) {
-               // We want to avoid the executor if everything is complete...
-               // However, we can't execute the context if there are 
executions pending
-               // We need to use the executor on this case
-               if (EXECUTORS_PENDING_UPDATER.get(this) == 0) {
-                  // No need to use an executor here or a context switch
-                  // there are no actions pending.. hence we can just execute 
the task directly on the same thread
-                  executeNow = true;
-               } else {
-                  execute(completion);
-               }
-            } else {
-               if (storeOnly) {
-                  if (storeLined == stored && 
EXECUTORS_PENDING_UPDATER.get(this) == 0) {
-                     executeNow = true;
+            switch (consistencyLevel) {
+               case storage:
+                  if (storeOnlyTasks == null) {
+                     storeOnlyTasks = new LinkedList<>();
+                     if (minimalStore == Long.MAX_VALUE) minimalStore = 
storeLined;

Review Comment:
   I am removing these variables.   they were at some point used to verify if 
the needle had moved and if I needed to further verify the tasks.
   
   At these time, these variables are simply verifying if the value is not 
null, since it's not being set to a minimal after completions.
   
   
   I will just remove them and keep the current semantics. Fixing it with the 
proper needle could make things unstable.. so I will just do what's best now.. 
remove them.... (less chance to introduce bugs).





Issue Time Tracking
-------------------

    Worklog Id:     (was: 931764)
    Time Spent: 2h 20m  (was: 2h 10m)

> Add configuration option to relax syncs journal replication for Mirror Target
> -----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-5001
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-5001
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>    Affects Versions: 2.37.0
>            Reporter: Clebert Suconic
>            Assignee: Clebert Suconic
>            Priority: Major
>             Fix For: 2.38.0
>
>          Time Spent: 2h 20m
>  Remaining Estimate: 0h
>
> When I worked on AMQP Mirror I did not actually envision being used with 
> journal replication. I actually thought more about adding multiple mirrored 
> options instead.
> However an user reported me that when using mirror and journal replication 
> combined, the sends could take a lot longer to happen (some normal latency) 
> and the acks would eventually be missed.
> I should add an option to ignore the replication for the Mirror Target.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to