Openbravo Issue Tracking System - Retail Modules
View Issue Details
0038036Retail ModulesStoreServerpublic2018-03-03 11:372018-03-13 17:44
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
 
AugustoMauch
No
0038036: SS in online mode always forward all requests to the CS
To prevent CAP-consistency problems the queries for (transactional) data should happen on the same server in which the data is updated. This means that in online mode all queries/requests from WebPOS should be forwarded to the CS. The WebPOS systems should still go through the SS to ensure that they all go offline at the same time.

In offline mode the WP systems work on the SS. To prevent WP working on an inconsistent system the following cases should be handled:
- going offline with sync errors from CS to SS: in this case SS is inconsistent, the WP are not allowed to work on the SS, a message should be given
- when there are version differences between SS and CS then the user can work through the SS in online mode as all the requests are forwarded to the CS
- the WP systems can work through the SS when it is online and reloading, so reloading is not blocking, only mandatory reloading is blocking
- data pending to be synced from CS to SS is no reason to stay offline. Only data pending to be synced from SS to CS is reason to stay offline

Documentation should be updated to.
Install multi-server
Try different scenarios:
- basic online
- going offline without sync errors
- going offline with sync errors from CS to SS from the start
- going offline with sync errors from CS to SS occurring after going offline
- going offline and then see if transition to online happens in case CS has sync errors
- going offline and then see if transition to online does not happen in case SS has sync errors
- check that non-mandatory reloading does not block WP in online mode
- check that mandatory reloading does block WP in online mode
- check that version differences does not block WP in online mode
- check that version differences do block WP in offline mode
Several changes in related code
No tags attached.
related to defect 0037851 closed marvintm Request timeout should apply to the whole process, and not just the query 
related to design defect 0038123 closed mtaal API Change: MultiServerJSONProcess/CashupSynchronized 
related to design defect 0038127 closed mtaal Storeserver allow going online even if there are pending data to sync from CS to SS 
diff 38036-giftcard-5.diff (502) 2018-03-13 12:27
https://issues.openbravo.com/file_download.php?file_id=11636&type=bug
diff 38036-retail-sync-5.diff (46,628) 2018-03-13 12:27
https://issues.openbravo.com/file_download.php?file_id=11637&type=bug
diff 38036-replication-5.diff (622) 2018-03-13 12:27
https://issues.openbravo.com/file_download.php?file_id=11638&type=bug
diff 38036-mobile-core-5.diff (36,994) 2018-03-13 12:27
https://issues.openbravo.com/file_download.php?file_id=11639&type=bug
diff 38036-retail-posterminal-5.diff (6,406) 2018-03-13 12:28
https://issues.openbravo.com/file_download.php?file_id=11640&type=bug
Issue History
2018-03-03 11:37mtaalNew Issue
2018-03-03 11:37mtaalAssigned To => mtaal
2018-03-03 11:37mtaalTriggers an Emergency Pack => No
2018-03-05 06:17mtaalRelationship addeddepends on 0037851
2018-03-05 06:17mtaalRelationship deleteddepends on 0037851
2018-03-05 06:17mtaalRelationship addedrelated to 0037851
2018-03-05 06:20mtaalNote Added: 0102966
2018-03-05 11:49mtaalFile Added: 38036-store-sync.diff
2018-03-05 11:49mtaalFile Added: 38036-mobile-core.diff
2018-03-06 08:25hgbotCheckin
2018-03-06 08:25hgbotNote Added: 0103004
2018-03-06 08:25hgbotStatusnew => resolved
2018-03-06 08:25hgbotResolutionopen => fixed
2018-03-06 08:25hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/e8697b438f443e662b07da6f67535d2d41cbf47e [^]
2018-03-06 08:25mtaalReview Assigned To => AugustoMauch
2018-03-06 08:27mtaalNote Added: 0103005
2018-03-06 08:28mtaalNote Added: 0103006
2018-03-09 22:13mtaalFile Added: replication-38036-2.diff
2018-03-09 22:13mtaalFile Added: storeserver-sync-38036-2.diff
2018-03-09 22:13mtaalFile Added: mobile-core-38036-2.diff
2018-03-10 10:24mtaalFile Deleted: 38036-store-sync.diff
2018-03-10 10:24mtaalFile Deleted: 38036-mobile-core.diff
2018-03-10 10:24mtaalFile Deleted: replication-38036-2.diff
2018-03-10 10:25mtaalFile Deleted: storeserver-sync-38036-2.diff
2018-03-10 10:25mtaalFile Deleted: mobile-core-38036-2.diff
2018-03-10 10:25mtaalFile Added: gift-cards-38036-1.diff
2018-03-10 10:26mtaalFile Added: mobile-core-38036-4.diff
2018-03-10 10:26mtaalFile Added: retail-sync-1.diff
2018-03-10 10:27mtaalFile Added: replication-1.diff
2018-03-13 12:27mtaalFile Deleted: gift-cards-38036-1.diff
2018-03-13 12:27mtaalFile Deleted: mobile-core-38036-4.diff
2018-03-13 12:27mtaalFile Deleted: retail-sync-1.diff
2018-03-13 12:27mtaalFile Deleted: replication-1.diff
2018-03-13 12:27mtaalFile Added: 38036-giftcard-5.diff
2018-03-13 12:27mtaalFile Added: 38036-retail-sync-5.diff
2018-03-13 12:27mtaalFile Added: 38036-replication-5.diff
2018-03-13 12:27mtaalFile Added: 38036-mobile-core-5.diff
2018-03-13 12:28mtaalFile Added: 38036-retail-posterminal-5.diff
2018-03-13 15:38hgbotCheckin
2018-03-13 15:38hgbotNote Added: 0103192
2018-03-13 15:38hgbotCheckin
2018-03-13 15:38hgbotNote Added: 0103193
2018-03-13 15:39hgbotCheckin
2018-03-13 15:39hgbotNote Added: 0103194
2018-03-13 15:44hgbotCheckin
2018-03-13 15:44hgbotNote Added: 0103195
2018-03-13 15:50hgbotCheckin
2018-03-13 15:50hgbotNote Added: 0103196
2018-03-13 16:19AugustoMauchNote Added: 0103199
2018-03-13 16:19AugustoMauchStatusresolved => closed
2018-03-13 17:09mtaalRelationship addedrelated to 0038123
2018-03-13 17:44mtaalNote Added: 0103217
2018-03-13 19:55mtaalRelationship addedrelated to 0038127

Notes
(0102966)
mtaal   
2018-03-05 06:20   
Note: the resolution of this issue depends on 37851 because 37851 moves the request getreader/getcontent to after the calls to MobileServiceRequestAllowedHandlers
(0103004)
hgbot   
2018-03-06 08:25   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: e8697b438f443e662b07da6f67535d2d41cbf47e
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 06 08:25:16 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/e8697b438f443e662b07da6f67535d2d41cbf47e [^]

Fixes issue 38036: SS in online mode always forward all requests to the CS
Code to forward to CS in online mode, handle invalid offline case and allow going online in more cases.

- AD_Message: added new text/title for popup in case of an invalid offline
- RetailSynchronizationRequestAllowedHandler: several changes:
> for reload: only stop webpos in case of mandatory reload
> send invalid-offline code if the SS is offline with sync errors when going offline
> forward requests to the CS, added new methods to do that, also handling error cases
- StoreServerVersionHandler: remove code which prevents working of CS and SS are in different versions, in online mode this is allowed
- added new javascript to show invalid offline mode popup
- SyncStatusOnlineTransitionHandler: allow going online also if there are things pending from CS, now only things pending from SS block online
- MobileServerEventHandler: when a mobile server definition is saved then also update the incoming error flag when state of the server is changed to offline

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/retail/storeserver/synchronization/RetailSynchronizationRequestAllowedHandler.java
M src/org/openbravo/retail/storeserver/synchronization/StoreServerVersionHandler.java
M src/org/openbravo/retail/storeserver/synchronization/StoreSynchronizationComponentProvider.java
M src/org/openbravo/retail/storeserver/synchronization/SyncStatusOnlineTransitionHandler.java
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/MobileServerEventHandler.java
A web/org.openbravo.retail.storeserver.synchronization/js/responseCallbackHandler.js
---
(0103005)
mtaal   
2018-03-06 08:27   
Tests done:
- basic online --> search product, cash man, create BP create ticket, cashup, checked also syncing back to SS
- going offline without sync errors --> offline mode with search product, create ticket, cashup, check sync back to CS
- going offline with sync errors from CS to SS from the start
- going offline with sync errors from CS to SS occurring after going offline
- going offline and then see if transition to online happens in case CS has sync errors
- going offline and then see if transition to online does not happen in case SS has sync errors
- check that non-mandatory reloading does not block WP in online mode
- check that mandatory reloading does block WP in online mode
- check that version differences does not block WP in online mode
- check that version differences do block WP in offline mode
(0103006)
mtaal   
2018-03-06 08:28   
Mobile core push:
https://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/d880fc5e1aea [^]

Related to issue: 38036: SS in online mode always forward all requests to the CS
Changes to server controller package of mobile core to facilitate forwarding calls from SS to CS in online mode.

- new column added to mobile server definition table to keep track if there were incoming sync errors when going offline
- added comment to mobileservice for change of related issue which moves the getRequestContent to after the calls to MobileServiceRequestHandler
- moved constants from the MultiServerJSONProcess to the MobileServerRequestExecutor
- In MultiServerJSONProcess: corrected a call to OBMOBCUtils.createSimpleErrorJson to send the message code instead of the text
- SynchronizedServerProcessCaller: use new constants
(0103192)
hgbot   
2018-03-13 15:38   
Repository: erp/pmods/org.openbravo.retail.giftcards
Changeset: 04080e5346c296e1ffff8d3c2b5f545dcdb10672
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 13 15:37:58 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.giftcards/rev/04080e5346c296e1ffff8d3c2b5f545dcdb10672 [^]

Related to issue 38036: SS in online mode always forward all requests to the CS
Remove deprecated method usage

---
M src/org/openbravo/retail/giftcards/FindGiftCard.java
---
(0103193)
hgbot   
2018-03-13 15:38   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: bb37f64fe7c1c549ac809a4dab3f1fdc2d55b2c7
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 13 15:38:41 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/bb37f64fe7c1c549ac809a4dab3f1fdc2d55b2c7 [^]

Related to issue 38036: SS in online mode always forward all requests to the CS
Removed non-used method

---
M src/org/openbravo/replication/symmetricds/diagnosis/RemoteStoreServerDiagnosisProcess.java
---
(0103194)
hgbot   
2018-03-13 15:39   
Repository: erp/pmods/org.openbravo.retail.posterminal
Changeset: 941e0b9681656fb24def0f215c6a2712edfbad58
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 13 15:39:39 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.posterminal/rev/941e0b9681656fb24def0f215c6a2712edfbad58 [^]

Related to issue 38036: SS in online mode always forward all requests to the CS
Synchronized Cashup is not needed anymore as in online mode all calls are done
to CS through SS.

---
M web/org.openbravo.retail.posterminal/js/utils/cashUpReportUtils.js
R src/org/openbravo/retail/posterminal/master/CashupSynchronized.java
---
(0103195)
hgbot   
2018-03-13 15:44   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: b0120b99cc374e522c0bd067e89fec1d4362bea0
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 13 15:44:19 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/b0120b99cc374e522c0bd067e89fec1d4362bea0 [^]

Related to issue 38036: SS in online mode always forward all requests to the CS

- Added description to new element record
- JSONProcessSimple: transition code has been moved to the RetailSynchronizedRequestHandler
- MobileService: change the request allowed handler concept to a more general MobileServiceRequestHandler
- MobileServerRequestExecutor: formatting changes
- MultiServerJSONProcess: large clean up as the handling of online/offline calls are now done through the
MobileServiceRequestHandler. Only the code related to creating import entries and handling duplicate requests remains.
Removed code which is not used anymore.
- SynchronizedServerProcessCaller: formatting changes

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src/org/openbravo/mobile/core/process/JSONProcessSimple.java
M src/org/openbravo/mobile/core/process/MobileService.java
M src/org/openbravo/mobile/core/servercontroller/MobileServerRequestExecutor.java
M src/org/openbravo/mobile/core/servercontroller/MultiServerJSONProcess.java
M src/org/openbravo/mobile/core/servercontroller/SynchronizedServerProcessCaller.java
---
(0103196)
hgbot   
2018-03-13 15:50   
Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: 6885b3bb0eebe473d7f44e868c7fdc7b091ba1cc
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Mar 13 15:50:00 2018 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/6885b3bb0eebe473d7f44e868c7fdc7b091ba1cc [^]

Related to issue 38036: SS in online mode always forward all requests to the CS

- RecomputeVersionModuleHandler: removed non used method
- RetailSynchronizationRequestAllowedHandler renamed to RetailSynchronizationRequestHandler
- added handling of transitioning and other states in RetailSynchronizationRequestHandler
- RetrieveServerVersionStatus, StoreSynchronizationComponentProvider: formatting changes
- SyncStatusOnlineTransitionHandler: check for importentries sync back from CS-->SS before going online
- MobileServerEventHandler: updated sql and formatting changes, only set offline-error-flag when it needs to be changed

---
M src/org/openbravo/retail/storeserver/synchronization/RecomputeVersionModuleHandler.java
M src/org/openbravo/retail/storeserver/synchronization/RetrieveServerVersionStatus.java
M src/org/openbravo/retail/storeserver/synchronization/StoreServerVersionHandler.java
M src/org/openbravo/retail/storeserver/synchronization/StoreSynchronizationComponentProvider.java
M src/org/openbravo/retail/storeserver/synchronization/SyncStatusOnlineTransitionHandler.java
M src/org/openbravo/retail/storeserver/synchronization/eventhandler/MobileServerEventHandler.java
A src/org/openbravo/retail/storeserver/synchronization/RetailSynchronizationRequestHandler.java
R src/org/openbravo/retail/storeserver/synchronization/RetailSynchronizationRequestAllowedHandler.java
---
(0103199)
AugustoMauch   
2018-03-13 16:19   
Code reviewed and verified
(0103217)
mtaal   
2018-03-13 17:44   
Updated the image and docs here:
http://wiki.openbravo.com/wiki/Retail:Store_Server#Online_.26_Offline_concepts_of_Store_Servers [^]