Anonymous | Login
Project:
RSS
  
News | My View | View Issues | Roadmap | Summary

View Issue DetailsJump to Notes ] Issue History ] Print ]
ID
0035049
TypeCategorySeverityReproducibilityDate SubmittedLast Update
defect[Retail Modules] StoreServermajorhave not tried2017-01-24 17:542017-03-09 10:43
ReporterAugustoMauchView Statuspublic 
Assigned ToAugustoMauch 
PrioritynormalResolutionfixedFixed in VersionRR17Q2
StatusclosedFix in branchFixed in SCM revision71fbeaaa3d7a
ProjectionnoneETAnoneTarget Version
OSAnyDatabaseAnyJava version
OS VersionDatabase versionAnt version
Product VersionSCM revision 
Review Assigned Tomtaal
Regression level
Regression date
Regression introduced in release
Regression introduced by commit
Triggers an Emergency PackNo
Summary

0035049: ServerStateBackground performance can be improved

DescriptionThe ServerStateBackground process, used for updating the state of the mobile servers, works currently like this:
- If the current server is a central server, it pings (it makes a remote call to MobileServerStatusInformation) all the store servers and updates their statuses.
- If the current server is a store server, it pings the central server. If the central is offline, the store server will transition to online too.

In this approach the central server is pinged by the store servers very often to retrieve its status. In a test performed using 200 stores, almost 200 connections were constantly being used in the central server to manage the pings received by the store servers.

A better approach would be to ping only from the central to the store servers, and to update a timestamp in the store servers when the ping is received. Then, a store can know if its central server is offline if it has not received a ping in a given period of time.
Steps To Reproduce-
TagsNo tags attached.
Attached Filesdiff file icon mobile-core.diff [^] (5,544 bytes) 2017-02-14 17:44 [Show Content]

- Relationships Relation Graph ] Dependency Graph ]
related to defect 0035292 closedAugustoMauch API Change: Ping Service and Trigger State columns should be deleted 
related to defect 0035556 closedAugustoMauch Server status ping periodicity should only be controlled by OBMOBC_Ping_Periodicity preference 

-  Notes
(0094066)
hgbot (developer)
2017-02-06 10:48

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: f48f938aa9c41c70560bc6c4601162ba2e22fa34
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 24 18:07:10 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/f48f938aa9c41c70560bc6c4601162ba2e22fa34 [^]

Related with issue 35049: Custom ping service is no longer used

As part of the effort to improve the performance of ServerStateBackground, the process is going to be refactored and simplified. As a first step, the use the mobile server ping service is going to be discontinued, instead always MobileServerStatusInformation, the default ping service, will be used.

---
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0094067)
hgbot (developer)
2017-02-06 10:48

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 2db5d266c78e2e54e124a9bd3eeeadc6c84f00ef
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 31 17:20:57 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/2db5d266c78e2e54e124a9bd3eeeadc6c84f00ef [^]

Related with issue 35049: Adds the OBMOBC_Ping_Periodicity property

A new value has been added to the list of available properties: OBMOBC_Ping_Periodicity. This property will be used to know how often the ping to request the status done from the central to the store server.

---
M src-db/database/sourcedata/AD_REF_LIST.xml
---
(0094068)
hgbot (developer)
2017-02-06 10:48

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c475a6f3c41e945e64b74ab9633909aabce3631e
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 31 17:27:55 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c475a6f3c41e945e64b74ab9633909aabce3631e [^]

Related with issue 35049: Server state bg process is scheduled automatically

The Server state background process is now scheduled automatically in a context listener. The periodicity will be taken from the OBMOBC_Ping_Periodicity, if it is not defined it will be
 executed every 5 minutes. If there are other process requests that reference the server state background process, they are unscheduled.

This context listener is executed before the context listener that starts the quartz scheduler.

---
M src-db/database/sourcedata/AD_MODEL_OBJECT.xml
A src/org/openbravo/mobile/core/listener/StatusBackgroundProcessScheduler.java
---
(0094069)
hgbot (developer)
2017-02-06 10:48

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: cde8ee3fa33497260319545b75ae5e8d4f7e56da
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Jan 31 17:36:28 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/cde8ee3fa33497260319545b75ae5e8d4f7e56da [^]

Fixes issue 35049:Server status ping is only done from central to store servers

The ServerStateBackground process, that is utilized to request and update the status of other servers, has been modified so that it only needs to be executed in the central server. Before this change it was required to execute it also on store servers, and that resulted in a lot of pings done simultaneously to the central server.

The new approach is the following:
- When the process is executed in a central server, it will ping all the store servers, and the ping itself will updated a new column in the store servers called last_ping.
- When it is executed in the store servers, the stores servers will just check when just the last time that the central server pinged it. If more than 3 pings have been lost it will be assumed that the central server is offline (otherwise the store would have been pinged sooner). The OBMOBC_Ping_Periodicity property is used to determine how often the central server pings the store servers.

---
M src-db/database/model/tables/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/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0094070)
hgbot (developer)
2017-02-06 10:48

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 3a62454ca392b873144a82190743a4545150cda1
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Feb 06 10:33:05 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/3a62454ca392b873144a82190743a4545150cda1 [^]

Related with issue 35049: Adds event handler to ensure only one process request

The ServerStateBackgroundEventHandler will ensure that new process requests that reference the server state background process cannot be manually added, and that the process request added by the StatusBackgroundProcessScheduler cannot be deleted.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
A src/org/openbravo/mobile/core/servercontroller/ServerStateBackgroundEventHandler.java
---
(0094122)
hgbot (developer)
2017-02-07 12:53

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: c8f0bdae3e33bed121adc734c7e50c68e6f9baf9
Author: Martin Taal <martin.taal <at> openbravo.com>
Date: Tue Feb 07 12:53:05 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/c8f0bdae3e33bed121adc734c7e50c68e6f9baf9 [^]

Related to issue 35049: prevent NPE when last ping is not yet set

---
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0094124)
hgbot (developer)
2017-02-07 14:27

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: ac1a6d0b81546542bd8497472018cf2228d85240
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 07 14:26:08 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ac1a6d0b81546542bd8497472018cf2228d85240 [^]

Related with issue 35049: Removes pingservice column

The pingservice column was used by the previous approach of the Server State background process, it is no longer needed.

---
M src-db/database/model/tables/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
---
(0094129)
hgbot (developer)
2017-02-07 16:20

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: a168281aafc750f9f824c0f02537fd2f7a4f11ca
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Tue Feb 07 16:19:50 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/a168281aafc750f9f824c0f02537fd2f7a4f11ca [^]

Related with issue 35049: Remove reference to pingservice

The MobileMainServerCheck referenced pingservice, a column that is no longer used. Now the ping service not configurable, instead MobileServerStatusInformation is always used.

---
M src/org/openbravo/mobile/core/servercontroller/MobileMainServerCheck.java
---
(0094276)
hgbot (developer)
2017-02-13 17:25

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 1527793d521c77e37c2396e3822988049ce6c886
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Feb 13 17:24:00 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/1527793d521c77e37c2396e3822988049ce6c886 [^]

Related with issue 35049: Updates ping properly

When the central server pinged the store server, it was updating the entry of obmobc_server_definition related with the target store. But then the store was checking the value of the central server, so it was never set.

Now the central server updates the entry of obmobc_server_definition related with the central. Also, if the store server checks the ping and it is not null, it will updated it to the current time.

---
M src/org/openbravo/mobile/core/servercontroller/MobileServerStatusInformation.java
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0094286)
hgbot (developer)
2017-02-13 19:37

Repository: erp/pmods/org.openbravo.mobile.core.es_ES
Changeset: 9e77a119da49e32e5703da7ba01e62f8c1cc9dcb
Author: Rafael Queralta Pozo <rqueralta <at> nauta.cu>
Date: Mon Feb 13 12:12:30 2017 -0500
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core.es_ES/rev/9e77a119da49e32e5703da7ba01e62f8c1cc9dcb [^]

Related to issue 35049: Removes pingservice column translation

---
M referencedata/translation/es_ES/AD_ELEMENT_TRL_es_ES.xml
---
(0094324)
mtaal (manager)
2017-02-14 16:14

Added doc for new preference: http://wiki.openbravo.com/wiki/Store_and_Multi_Server_Preferences [^]
(0094327)
mtaal (manager)
2017-02-14 17:47

Hi,
Some remarks:
- I don't we should prevent a user from creating additional process requests. So the event handler is not needed, nor does the context listener need to unschedule other process requests.

- the lastping column should be excluded in synchronized table

- Attached a diff with some additional changes:
> used the word 'seconds' in the description of the property
> I noticed that when transitioning to offline already the system was again starting a transition to offline thread, so prevented that from happening
> the code to determine which servers should get a ping is run now exclusively on the central server, so the query can be simplified.
Can you check the diff and apply it if you are okay with it?
(0094380)
hgbot (developer)
2017-02-16 09:39

Repository: erp/pmods/org.openbravo.retail.storeserver.synchronization
Changeset: af6a8777ade192eed2d2179387436a74aebebfab
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Feb 16 09:39:04 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.retail.storeserver.synchronization/rev/af6a8777ade192eed2d2179387436a74aebebfab [^]

Related with issue 35049: Excludes last_ping column from synchronization

---
M src-db/database/sourcedata/STRSYNC_EXCLUDEDCOL.xml
---
(0094381)
hgbot (developer)
2017-02-16 09:46

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: bddf2098c43aa9c2bfd029a6c89267c4fa67b479
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Feb 16 09:44:29 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/bddf2098c43aa9c2bfd029a6c89267c4fa67b479 [^]

Related with issue 35049: Applies some code review changes:
- Label has been changed from (s) to (seconds)
- Query to obtain store servers to send to has been simplified
- A type (threashold -> threshold) has been fixed
- Transition to offline is not triggered if server is already transitioning to offline

---
M src-db/database/sourcedata/AD_REF_LIST.xml
M src/org/openbravo/mobile/core/servercontroller/MobileServerController.java
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackground.java
---
(0094403)
hgbot (developer)
2017-02-16 18:39

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: ebf6b29e7761caf2f19856c364fe2109e6b11007
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Thu Feb 16 18:35:38 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/ebf6b29e7761caf2f19856c364fe2109e6b11007 [^]

Related with issue 35049: Last ping field should be read only in the UI

---
M src-db/database/sourcedata/AD_COLUMN.xml
---
(0094458)
hgbot (developer)
2017-02-20 11:37

Repository: erp/pmods/org.openbravo.mobile.core
Changeset: 71fbeaaa3d7aeb3efe69bcbddbae403a6be687d6
Author: Augusto Mauch <augusto.mauch <at> openbravo.com>
Date: Mon Feb 20 11:37:01 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/71fbeaaa3d7aeb3efe69bcbddbae403a6be687d6 [^]

Fixes issue 35049: Process requests can be added manually if not scheduled

Now the event handler that controls how new process requests for the Server State Background process is less strict. It allows adding new process request if the timing option is 'Execute Immediately'. This can be useful if the user wants to run the process immediately, without having to wait until the next scheduled run.

It is still not possible to add new scheduled process requests for the Server State Background process.

---
M src-db/database/sourcedata/AD_MESSAGE.xml
M src/org/openbravo/mobile/core/servercontroller/ServerStateBackgroundEventHandler.java
---
(0094623)
hgbot (developer)
2017-02-27 10:30

Repository: erp/pmods/org.openbravo.mobile.core.es_ES
Changeset: 33930842424c099936760d83df99cdcfda1a5c47
Author: Antonio Moreno <antonio.moreno <at> openbravo.com>
Date: Mon Feb 27 10:23:35 2017 +0100
URL: http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core.es_ES/rev/33930842424c099936760d83df99cdcfda1a5c47 [^]

Related to issue 35049. Some translation improvements

---
M referencedata/translation/es_ES/AD_ELEMENT_TRL_es_ES.xml
M referencedata/translation/es_ES/AD_MENU_TRL_es_ES.xml
M referencedata/translation/es_ES/AD_MESSAGE_TRL_es_ES.xml
M referencedata/translation/es_ES/AD_REF_LIST_TRL_es_ES.xml
M referencedata/translation/es_ES/AD_TAB_TRL_es_ES.xml
M referencedata/translation/es_ES/AD_WINDOW_TRL_es_ES.xml
---
(0094624)
marvintm (manager)
2017-02-27 10:33

Sorry, last commit should instead be associated with issue 35086
(0094862)
mtaal (manager)
2017-03-09 10:43

Reviewed and tested

- Issue History
Date Modified Username Field Change
2017-01-24 17:54 AugustoMauch New Issue
2017-01-24 17:54 AugustoMauch Assigned To => StoreServer
2017-01-24 17:54 AugustoMauch Triggers an Emergency Pack => No
2017-01-24 23:29 mtaal Assigned To StoreServer => AugustoMauch
2017-02-06 10:40 AugustoMauch Review Assigned To => mtaal
2017-02-06 10:48 hgbot Checkin
2017-02-06 10:48 hgbot Note Added: 0094066
2017-02-06 10:48 hgbot Checkin
2017-02-06 10:48 hgbot Note Added: 0094067
2017-02-06 10:48 hgbot Checkin
2017-02-06 10:48 hgbot Note Added: 0094068
2017-02-06 10:48 hgbot Checkin
2017-02-06 10:48 hgbot Note Added: 0094069
2017-02-06 10:48 hgbot Status new => resolved
2017-02-06 10:48 hgbot Resolution open => fixed
2017-02-06 10:48 hgbot Fixed in SCM revision => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/cde8ee3fa33497260319545b75ae5e8d4f7e56da [^]
2017-02-06 10:48 hgbot Checkin
2017-02-06 10:48 hgbot Note Added: 0094070
2017-02-07 12:53 hgbot Checkin
2017-02-07 12:53 hgbot Note Added: 0094122
2017-02-07 14:27 hgbot Checkin
2017-02-07 14:27 hgbot Note Added: 0094124
2017-02-07 16:20 hgbot Checkin
2017-02-07 16:20 hgbot Note Added: 0094129
2017-02-13 17:25 hgbot Checkin
2017-02-13 17:25 hgbot Note Added: 0094276
2017-02-13 19:37 hgbot Checkin
2017-02-13 19:37 hgbot Note Added: 0094286
2017-02-14 16:14 mtaal Note Added: 0094324
2017-02-14 17:44 mtaal File Added: mobile-core.diff
2017-02-14 17:47 mtaal Note Added: 0094327
2017-02-14 17:47 mtaal Status resolved => new
2017-02-14 17:47 mtaal Resolution fixed => open
2017-02-16 09:39 hgbot Checkin
2017-02-16 09:39 hgbot Note Added: 0094380
2017-02-16 09:46 hgbot Checkin
2017-02-16 09:46 hgbot Note Added: 0094381
2017-02-16 18:39 hgbot Checkin
2017-02-16 18:39 hgbot Note Added: 0094403
2017-02-20 11:37 hgbot Checkin
2017-02-20 11:37 hgbot Note Added: 0094458
2017-02-20 11:37 hgbot Status new => resolved
2017-02-20 11:37 hgbot Resolution open => fixed
2017-02-20 11:37 hgbot Fixed in SCM revision http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/cde8ee3fa33497260319545b75ae5e8d4f7e56da [^] => http://code.openbravo.com/erp/pmods/org.openbravo.mobile.core/rev/71fbeaaa3d7aeb3efe69bcbddbae403a6be687d6 [^]
2017-02-27 10:30 hgbot Checkin
2017-02-27 10:30 hgbot Note Added: 0094623
2017-02-27 10:33 marvintm Note Added: 0094624
2017-03-09 10:29 mtaal Relationship added related to 0035292
2017-03-09 10:43 mtaal Note Added: 0094862
2017-03-09 10:43 mtaal Status resolved => closed
2017-03-09 10:43 mtaal Fixed in Version => RR17Q2
2017-03-17 10:49 AugustoMauch Relationship added related to 0035556


Copyright © 2000 - 2009 MantisBT Group
Powered by Mantis Bugtracker