Openbravo Issue Tracking System - Retail Modules
View Issue Details
0035495Retail ModulesStoreServerpublic2017-03-13 13:302017-03-30 17:53
mtaal 
mtaal 
normalmajorhave not tried
closedfixed 
5
 
 
AugustoMauch
No
0035495: Keep track if a store server needs to sync with central before allowing connections
The requirement is to keep track if a store server is forced to first sync with central before it allows WebPOS systems to work with it.

The scenario is as follows:
- a new flag is added to mobile server table: sync-reload-completed
- default this flag is y
- when the store server backup is restored the system should block WebPOS systems until the reload has been done
- therefore when restoring the backup this flag should first be set to N
- it will be set to Y after the reload has happened
- while the flag is N the server should not allow WebPOS systems to work on it
See description
See Description
No tags attached.
Issue History
2017-03-13 13:30mtaalNew Issue
2017-03-13 13:30mtaalAssigned To => mtaal
2017-03-13 13:30mtaalTriggers an Emergency Pack => No
2017-03-19 10:40hgbotCheckin
2017-03-19 10:40hgbotNote Added: 0095392
2017-03-19 10:56hgbotCheckin
2017-03-19 10:56hgbotNote Added: 0095402
2017-03-19 10:56hgbotCheckin
2017-03-19 10:56hgbotNote Added: 0095403
2017-03-19 10:56hgbotCheckin
2017-03-19 10:56hgbotNote Added: 0095404
2017-03-19 10:56hgbotStatusnew => resolved
2017-03-19 10:56hgbotResolutionopen => fixed
2017-03-19 10:56hgbotFixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/2d9fcf41d77acbd00d551fd957031483d120ff89 [^]
2017-03-20 10:49mtaalReview Assigned To => AugustoMauch
2017-03-21 12:25AugustoMauchNote Added: 0095465
2017-03-21 12:25AugustoMauchStatusresolved => new
2017-03-21 12:25AugustoMauchResolutionfixed => open
2017-03-21 12:25AugustoMauchNote Edited: 0095465bug_revision_view_page.php?bugnote_id=0095465#r14854
2017-03-21 12:27AugustoMauchNote Added: 0095466
2017-03-29 09:53hgbotCheckin
2017-03-29 09:53hgbotNote Added: 0095629
2017-03-29 09:57mtaalNote Added: 0095631
2017-03-29 16:56AugustoMauchStatusnew => scheduled
2017-03-29 17:38AugustoMauchStatusscheduled => resolved
2017-03-29 17:38AugustoMauchResolutionopen => fixed
2017-03-29 17:38AugustoMauchNote Added: 0095667
2017-03-29 17:38AugustoMauchStatusresolved => closed
2017-03-29 17:49hgbotCheckin
2017-03-29 17:49hgbotNote Added: 0095668
2017-03-29 17:49hgbotStatusclosed => resolved
2017-03-29 17:49hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/2d9fcf41d77acbd00d551fd957031483d120ff89 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/092421a978fef3535c0d69f6cac8a0baf82e1a27 [^]
2017-03-30 14:05AugustoMauchNote Added: 0095710
2017-03-30 14:05AugustoMauchStatusresolved => new
2017-03-30 14:05AugustoMauchResolutionfixed => open
2017-03-30 16:37mtaalNote Added: 0095725
2017-03-30 16:38hgbotCheckin
2017-03-30 16:38hgbotNote Added: 0095726
2017-03-30 16:38hgbotStatusnew => resolved
2017-03-30 16:38hgbotResolutionopen => fixed
2017-03-30 16:38hgbotFixed in SCM revisionhttp://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/092421a978fef3535c0d69f6cac8a0baf82e1a27 [^] => http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/7c226695d1ded9058045954779858d2f918a15f4 [^]
2017-03-30 17:53AugustoMauchNote Added: 0095732
2017-03-30 17:53AugustoMauchStatusresolved => closed

Notes
(0095392)
hgbot   
2017-03-19 10:40   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: db7935749dd52b91b565745fb79d784b124abc09
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:23:05 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/db7935749dd52b91b565745fb79d784b124abc09 [^]

Related to issue 35495: Keep track if a store server needs to sync with central before allowing connections
Smaller field/column changes for new field to maintain reload status

---
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_FIELD.xml
---
(0095402)
hgbot   
2017-03-19 10:56   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: d2a5e9cf21174fb299a378d2075938f1b85af75d
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:49:10 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/d2a5e9cf21174fb299a378d2075938f1b85af75d [^]

Related to issue 35495: Keep track if a store server needs to sync with central before allowing connections
Add new column reload status to mobile server, including new list-reference and adding it to the mobile server window

---
M src-db/database/model/modifiedTables/OBMOBC_SERVER_DEFINITION.xml
M src-db/database/sourcedata/AD_COLUMN.xml
M src-db/database/sourcedata/AD_ELEMENT.xml
M src-db/database/sourcedata/AD_FIELD.xml
M src-db/database/sourcedata/AD_REFERENCE.xml
M src-db/database/sourcedata/AD_REF_LIST.xml
---
(0095403)
hgbot   
2017-03-19 10:56   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: be88877e90d4db2a13e7f6c97cd3e929dfeb9836
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:50:08 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/be88877e90d4db2a13e7f6c97cd3e929dfeb9836 [^]

Related to issue 35495: Keep track if a store server needs to sync with central before allowing connections
Add ant task to set the system to forcibly reload at next startup

---
M build.xml
A src/org/openbravo/replication/symmetricds/task/SetMandatoryReloadFlagTask.java
---
(0095404)
hgbot   
2017-03-19 10:56   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 2d9fcf41d77acbd00d551fd957031483d120ff89
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Sun Mar 19 10:51:58 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/2d9fcf41d77acbd00d551fd957031483d120ff89 [^]

Fixes issue 35495: Keep track if a store server needs to sync with central before allowing connections
Added new thread-class to continue reload actions. Some reformatting. Removed system.exit as the acccess from WebPOS is anyway prevented.
Do less attempts to reload in case of non-mandatory reload

---
M src/org/openbravo/replication/symmetricds/SetupSymmetricListener.java
---
(0095465)
AugustoMauch   
2017-03-21 12:25   
In SetMandatoryReloadFlagTask, I think it is better to do the update using the mobile.server.key specified in the Openbravo.properties rather than using the iscurrent flag.

The iscurrent flag is programatically set in a context listener, users do not set it manually.

(0095466)
AugustoMauch   
2017-03-21 12:27   
I am not sure about setting the reload status to OK after five minutes if the reload was not mandatory [1]. Why not waiting until it is finished?

[1] https://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/2d9fcf41d77acbd00d551fd957031483d120ff89#l1.296 [^]
(0095629)
hgbot   
2017-03-29 09:53   
Repository: erp/pmods/org.openbravo.mobile.core
Changeset: ec32db46bde931331f2c1a3a22a4968a8997c2dd
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Mar 29 09:52:33 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ec32db46bde931331f2c1a3a22a4968a8997c2dd [^]

Fixes issue 35618, related to issue 35495: Keep track if a store server needs to sync with central before allowing connections

Add return to prevent double execution of super.service
Move the allow request handler to the getpost method so that the super class can correctly handle generic logic such as
cors requests

---
M src/org/openbravo/mobile/core/process/MobileService.java
---
(0095631)
mtaal   
2017-03-29 09:57   
To react on reviewers comment:
the idea to set reload status to OK after five minutes is that the reload is not mandatory, so the system should really start at some point. Otherwise restarting in offline mode is not possible.
(0095667)
AugustoMauch   
2017-03-29 17:38   
Code reviewed and verified
(0095668)
hgbot   
2017-03-29 17:49   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 092421a978fef3535c0d69f6cac8a0baf82e1a27
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Wed Mar 29 17:48:58 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/092421a978fef3535c0d69f6cac8a0baf82e1a27 [^]

Fixes issue 35495: Keep track if a store server needs to sync with central before allowing connections
Use the mobile server key to find the record to update

---
M src/org/openbravo/replication/symmetricds/task/SetMandatoryReloadFlagTask.java
---
(0095710)
AugustoMauch   
2017-03-30 14:05   
Two comments:
- If the set.mandatory.reload.flag.current.server is executed in a central server, it should not modify the flag, because the flag is only managed in Java for the store servers.
- It would be better if the update is done using xsql instead of DAL. That way we can avoid initializing dal just for one simple update.
(0095725)
mtaal   
2017-03-30 16:37   
Reaction: first change will be done. Second change will not, although comment is correct that DAL is heavy to initialize it is a task which is seldom done. So this means changing to xsql adds less value for now.
(0095726)
hgbot   
2017-03-30 16:38   
Repository: erp/pmods/org.openbravo.replication.symmetricds
Changeset: 7c226695d1ded9058045954779858d2f918a15f4
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Thu Mar 30 16:38:04 2017 +0200
URL: http://code.openbravo.com/erp/pmods/org.openbravo.replication.symmetricds/rev/7c226695d1ded9058045954779858d2f918a15f4 [^]

Fixes issue 35495: Keep track if a store server needs to sync with central before allowing connections
Throw exception if run on the central server

---
M src/org/openbravo/replication/symmetricds/task/SetMandatoryReloadFlagTask.java
---
(0095732)
AugustoMauch   
2017-03-30 17:53   
Code reviewed and verified