Retail:Store Server Initial Data Reload
When a store server is started it will always check with the central server if it is up-to-date with the data to be received from the central server. There are specific cases where the store server maybe not yet up-to-date:
- after install: there can be some time after the data export and the install of a store server. In this time period data changes can occur which need to be synched to the to-be-installed store server.
- after a restore of a backup. The backup might be slightly out-of-date with the central server data sync. Therefore an initial data reload is needed.
- after a shutdown of a store server. Also in this case the central server continuous to run and gathers data changes which need to be send to the store server.
The data reload logic is efficient in that it will only load the delta, the differences between the batches received in the store server before and new one's to be send from the central server.
Data Reload Status
A new field is present in the mobile server window: Reload Status.
This field can have the following values:
- OK: the data reload has been done or is not mandatory/needed so the OK status is fine
- Successfull Reload on Startup Needed: at the next startup the system will execute a mandatory reload, setting the status then to 'Reloading (Mandatory)'. This is a state which is only reached by setting it directly in the database using an ant task (see next section in this page)
- Reloading: the store server is executing a non-mandatory data reload
- Reloading (Mandatory): the store server is executing a mandatory data reload
Mandatory versus Non-Mandatory Reload - forcing mandatory reload at startup
A distinction is made mandatory and non-mandatory reload.
Non-Mandatory reload will try to reload data from the central server. But if the central server is not available (because the store is offline) it will (after trying the reload) allow access from WebPOS.
Mandatory reload is relevant for when a store server is restored from a backup which might have missing data. In case of mandatory reload a successful reload from the central server is needed before the store server will allow access from WebPOS.
There are three different ways to force a mandatory reload:
- by setting the store server reload status to mandatory reload before starting the store server. This can be done with the following ant task. To be executed on the store server from the root of the Openbravo server:
ant -f modules/org.openbravo.replication.symmetricds/build.xml set.mandatory.reload.flag.current.server
- by creating a file with the word/content 'replica' in it:
replicaThe file path (location and name) by default is '/etc/hpvswitch.flag'. But you can override it by setting the file path and name in the property 'reload.flag.file.location' in Openbravo.properties. The system will check for the existence of this file at startup. After a successful reload the system will set the value 'primary' in this file, so the mandatory reload is only triggered once.
- by setting the reload status of the store server to 'Successful Reload on Startup Needed'. This can be done in the Mobile Server window in the backoffice ERP. If you change this value in the central server Mobile Server window (for the store server mobile server record) then check if the value got correctly replicated to the store server. Alternatively you can visit the backoffice ERP in the store server directly and set the value there in its mobile server window. If the reload status of the server is set like this then at the next startup a mandatory reload is executed.
The reload logic is triggered when the store server is started. The following steps are executed:
- The store server requests from the central server if there are any batches to load. The store server does this by comparing the last data batch which was loaded from the central server. It requests the central server to resend any missing batches. If the store is offline then no connection can be made to the central server and no data reload is done.
- The store server reload status is set to 'Reloading'. If the reload is mandatory for correct operation of the store server the status will be 'Reloading (Mandatory)'
- The store server then periodically (every 30 seconds) checks if the data reload has been done. In addition all import entries should be processed.
- If this is the case then the reload status of the store server is changed to 'OK'.
- If after 5 minutes the store server has not finished the data reload there are 2 cases:
- Non-Mandatory data reload: this is the standard when the store goes offline during the data reload. As there is no connection to the central server the system can not load any data. The store should still be able to work so the server continues in the 'OK' status.
- Mandatory data reload: this status is relevant when a store server backup is restored. In this case the data reload is mandatory to be finished before the WebPOS clients can use the store server. In this case the reload status is changed and the store server continues to stay in 'Reloading (Mandatory)' status.
WebPOS Access Disabled during Data Reload
During the data reload the WebPOS system can not access the store server. This is notified to the user with a popup box as is shown below.