Openbravo Issue Tracking System - Retail Modules
View Issue Details
0037380Retail ModulesStoreServerpublic2017-11-24 07:162017-11-29 15:57
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
 
migueldejuana
No
0037380: Only do transition to online when it is possible
When a store server is offline it will automatically transition to online when the connection to the CS is restored.

However if there are blocking issues (like related to replication) then the SS will go offline again.

During this transition to online and back the system can not be used. As the system will retry transitioning this makes the system much less available.

Related docs:
http://wiki.openbravo.com/wiki/Store_Server_Online_and_Offline_Concepts [^]

http://wiki.openbravo.com/wiki/Store_and_Multi_Server_Preferences#Behavioral_Preferences [^]
(see transition to online wait time)
Install multi-server, set low transition to online failed wait time)
Cause a replication error from store to central
Put down CS, SS goes offline
Restart CS
SS will retry transition to online continuously
Do a pre-check in transition to online code if transition to online is possible
No tags attached.
causes defect 0037425 closed mtaal Repair formatting error and typos in submitted code 
Issue History
2017-11-24 07:16mtaalNew Issue
2017-11-24 07:16mtaalAssigned To => mtaal
2017-11-24 07:16mtaalTriggers an Emergency Pack => No
2017-11-26 13:33mtaalNote Added: 0100716
2017-11-26 23:07mtaalReview Assigned To => AugustoMauch
2017-11-26 23:10hgbotCheckin
2017-11-26 23:10hgbotNote Added: 0100718
2017-11-26 23:10hgbotStatusnew => resolved
2017-11-26 23:10hgbotResolutionopen => fixed
2017-11-26 23:10hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/54883ed296c8fc6b984af3f81166896ebd346643 [^]
2017-11-27 10:18mtaalReview Assigned ToAugustoMauch => migueldejuana
2017-11-29 15:57migueldejuanaNote Added: 0100813
2017-11-29 15:57migueldejuanaStatusresolved => closed
2017-11-30 11:27mtaalRelationship addedcauses 0037425

Notes
(0100716)
mtaal   
2017-11-26 13:33   
Easiest way to check the code is implement the transition to online handler and check server offline handlers as below.

Implement the handlers as shown below
Run multi-server
Stop CS so the SS goes offline
Restart CS, send a force transition to online
Check that the transition to online does not start even
Change the test handlers below to allow transition, send transition to online
Now it should go online

  public static class TESTForOffline extends CheckServerOfflineHandler {
    @Override
    public boolean isServerOffline() {
      return true;
    }
  }

  public static class TESTOnlineTransitionHandler extends
      MobileServerTransitionToOnlineHandler {

    @Override
    public void processTransactions() {
    }

    @Override
    public String getOfflineLog() {
      return "Checking offline TEST";
    }

    @Override
    public boolean isReadyToGoOnline() {
      return false;
    }
  }
}
(0100718)
hgbot   
2017-11-26 23:10   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 54883ed296c8fc6b984af3f81166896ebd346643
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Nov 26 23:10:17 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/54883ed296c8fc6b984af3f81166896ebd346643 [^]

Fixes issue 37380: Only do transition to online when it is possible
Do transition to online in two steps: only do it when possible, adding a new method to the api for checking if transition to online is possible, also call the check servers offline before actually going to transition

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerController.java
M src/org/openbravo/mobile/core/servercontroller/MobileServerTransitionToOnlineHandler.java
M src/org/openbravo/mobile/core/servercontroller/MobileServerUtils.java
---
(0100813)
migueldejuana   
2017-11-29 15:57   
Reviewed