Auto StateSync feature

Smartsite 7.3 - ...

As of Smartsite 7.3, the new Auto State Synchronization implementation is available.

This mechanism uses a database table (osStateSyncEventQueue) to record state sync events that take place and a Global WaitHandle to signal each process that there are new events available.

When this feature has been enabled, it is no longer necessary to configure WCF endpoints within the web.config and/or configure Outscaling Server Instances for state synchronization.

Implementation details

When saving an item using the legacy cms manager or the Smartsite 7 manager, one or more records are added to the osStateSyncEventQueue table. Each record describes a state sync message.
After writing the events to this queue table, the Global WaitHandle is signalled.

Each process entity (the legacy manager, the Smartsite 7 manager, the publication engine and the CmsServer) uses the same Global WaitHandle, so each process entity is signalled to check for new events within the osStateSyncEventQueue.

Each process entity then reads the new event(s), decides if the event is applicable and if so updates its internal state. Then it goes back to the waiting state until the next signal comes in.

Configuration

The new Auto State Synchronization mechanism isn't enabled by default. Also, notice that it is only applicable for server instances / process entities which uses the same database and which are running on the same machine.

To enable this new feature, follow the steps described below.

 

  • Within the smartiste.config configuration file, add an appSetting with key="UseAutoStateSync" and value="true".
  • Within the smartiste.config configuration file, specify the Site's Name using an appSetting:
 <appSettings>
  <add key="Name" value="DemoSite"/>
...
  <add key="UseAutoStateSync" value="true"/>
 </appSettings>

  • Within the Síte's registry, add/update the BackgroundComponents key:

StateSync background component

 

  • Open the Outscaling Console within the legacy manager and select Server Instances. The subscribers for both the local legacy cms manager and the local CmsServer should be removed.
    (These subscribers are no longer needed for state synchronization.)
  • Within the wwwmgr/web.config specify the Instance Id's for both the Smartsite 7 manager and the Cms Server:
  <appSettings>
   <add key="cmsserver.instanceid" value="DEMOSITE.CMSSERVER" />
   <add key="manager.instanceid" value="DEMOSITE.MGR" />
...
  </appSettings>
  • Restart the site / IIS.

When your server / site configuration is a single site, single server configuration (just the 4 server instances you are used to, each using the same shared database), you can even disable the regular Outscaling background component since State Synchronization is the only thing that needs to be done and this functionality is taken over by the new Auto State Synchronization implementation.

However, notice that the Outscaling EventSubscriber needs to remain enabled, since it is responsible for adding cms events (originating from the legacy manager) to the osStateSyncEventQueue table.

Advantages

The new Auto State Synchronization implementation has several advantages compared to the (state) synchronization relying on the WCF services and the (regular) Outscaling background component:

  • It takes less configuration; it is no longer required to configure addresses and/or user credentials on the Outscaling server instances and configure WCF endpoints within the web.config.
  • No advanced event assignment mechanism is needed, each process / server instance monitors the state sync event queue and acts on incoming events.
  • Much faster and more reliable.
  • Out-dated state sync events are automatically ignored.