How to resolve max index (server_index and share_index) errors

  • Updated

eSync requires that each database in a sync relationship have a unique ID. These server IDs are tracked in the 'server_index' value in the 'settings' table of the site's database, and are used to create unique ID ranges for content created in each environment, thus preventing collisions during eSync.  In addition, each database tracks the total number of databases involved in a specific eSync 'forest' in the 'share_index' value of the same table. 

An example of one of these types of errors is below. 

Invalid server index. Local server index: 1, Remote server index: 1
Local Exception:\nRemote Exception


MaxIndex

Max index errors generally occur in cases where there is disparity of either of these values on one side of the sync relationship. 

For a given relationship or 'forest' of relationships, the share_index values must match, while the server_index values must be unique.

For example, the error "Max index do not match. Local index:12, Remote index:11" would indicate that the 'share_index' values do not match.  Use the following SQL query to retrieve the values from a given database, and compare the returned values among the other databases in the relationship:

select server_index, share_index from settings

If you so choose, you can then correct the issue with the following queries:

** Note ** Back-up EVERY database in the relationship prior to any direct-editing **

To update the server_index:

update settings set server_index = x

To update the share_index:

update settings set share_index = x

In either case, replace x with the value you wish to set.  Also, note that the share_index value increments each time a new server is added to the 'forest', it must thus be larger than the largest of the server_index values.