Sync Service Settings
These settings live within the Sync Service's configuration (app.config) file. Any changes to these settings would require a restart of the Sync Service in order to take effect. It is assumed that the reader has a knowledge of how time requirements as well as the specific functionality desired for a specific instance of RPS.
General
The configuration settings inside the Sync Service application configuration file are located in the <appSettings> section of the document. This section will define each setting purpose and the valid values for the setting.
ContextCommandTimeout
Type: Integer
Default: 3600
Range: Any integer greater than or equal to 1. Recommended are value is 3600
Timeout, in seconds, for database calls from the Sync Service. Changing this value would alter the maximum amount of time a database call is allowed to execute. This prevents locking the database for abnormal amounts of time.
HttpClientTimeout
Type: Integer
Default: 3600
Range: Any integer greater than or equal to 1. Recommended are value is 3600
Timeout, in seconds, for HTTP(s) calls from the Sync Service. Changing this value would alter the amount of time a connection is allowed to be alive for a single HTTP(s) call. This would affect both the Sync operations as well as the requests to the Fileserver when synchronizing CDN packages
CreateClient
Type: Boolean
Default: True
Indicates whether or not to create a client to used to synchronize data changes with to and from the current node’s parent. The type of data synchronized when this setting is set to true includes target data, resources and properties, patch stream telemetry, etc. If this setting is set to false, all synchronization both to and from the parent will be disabled.
Logging
The following settings are for setting specific levels of Sync Service application logging.
SyncLogs
Type: Boolean
Default: True
Remarks: If the CreateClient setting is off, these logs will not synchronize because data synchronization is turned off.
Indicates whether or not to Synchronize logs with the parent Sync Service. Setting the value to true will cause the logs on the client to synchronize with its parent. Setting the value to false will disable this synchronization.
LogLevel
Type: Integer
Default: 4
Indicates the level of logging the sync service will use when synchronizing the logs to the parent node. When a log is made in RPS, it is assigned a log level. When the synchronization of logs occurs, it will send all logs with a level equal to and higher than the value set in this setting to the parent.
- Verbose – Setting this as the value will synchronize everything logged by the Sync service
- Debug – Contains information useful for debugging.
- Information – Contains general information.
- Warning – Contains warnings for the user to take note of. General indicates that a potential error may occur due to some action taken, but its not guaranteed that it will result in an error.
- Error – Contains information about an error that the Sync Service encountered.
- Fatal – Contains information about a catastrophic error that usually results in the partial or total loss of the Sync Service.
API Server
This section covers settings that are specific to the rest service endpoints for the Sync Service.
CreateServer
Type: Boolean
Default: True
Indicates whether or not to start a server instance to host the Sync Api endpoints. This server is needs to be enabled on both nodes in order to allow communications between them for both Syncing of data and CDN items. Setting this value to true will start the REST API server internally by the Sync Service. By this value to false, calls into the SyncService via remote sources would fail.
CDN Settings
This section contains settings for the content delivery network.
CreateCDN
Type: Boolean
Default: True
Indicates whether or not to enable the CDN indexer functionality of the Sync Service. By this option this option to true, you will turn on the CDN and any subsequent synchronization of the CDN with a parent CDN. Setting this value to false will not start the CDN and its synchronizations, thus stopping any new BITS transfers from occurring. This setting has no ties to enabling the file system or api server.
IndexerInterval
Type: Integer
Default: 3
Range: Any integer greater than or equal to 1. Recommended are value is 3
The interval, in minutes, that the CDN will synchronize. A larger value will increase the time between synchronizations. CDN synchronization will look at what files are currently on the system vs what files should be there. If the system is set to BITS, it will then request any missing files from its parent and begin the download.
CDN File Server
This section covers settings that are specific to the Content Delivery Network (CDN) File Server. The CDN File Server is the mechanism that transmits files to parent and child nodes.
CreateStaticFiles
Type: Boolean
Default: True
Indicates whether or not to start the FileServer in the Sync Service. This is required if the current node is expected to host CDN packages and distribute them downstream. In order to enable this service both the CreateServer setting must be true AND this setting must be true. That is because the file server endpoint is hosted in the API Server. Assuming the CreateServer setting is enabled, setting this value to true will allow for the downstream nodes to request packages from the current node. By setting this value to false, any requests for CDN packages by a child node will fail, stating the endpoint is not there (404 error).
FileServerOptions.RequestPath
Type: String
Default: /files
Remarks: The value MUST start with a “/” and must be a valid url
The part of the url that allows access to the CDN File Server where CDN files will be available from Sync Service. For example if the base was www.contoso.com, and the request path was /files, the endpoint to access the file server www.contoso.com/files.
FileServerOptions.EnableDirectoryBrowsing
Type: Boolean
Default: True
Indicates whether or not to allow directory browsing of the file server. Setting this option to true will allow an individual to hit the root file server endpoint and get the directory view for all static files (CDN files) on the node. Setting the value to false disables this ability.
FileServerOptions.EnableDefaultFiles
Type: Boolean
Default: False
Indicates whether or not to enable default files on the file server. When this option is set to true, the server will attempt to try to server out an index.html file when visiting the file server root. Setting this value to false will stop the attempt to serve out the index.html file.
Sync Testing
General
The goal of this testing is to verify correct data replication between nodes in various scenarios. See the below section for an overview of the sync scenarios and concepts which are tested.
Testing Scenarios
This section contains the scenarios for the Sync Service that are continually tested through the DevOps pipleline.
Synchronizing Upstream and Downstream Changes
Validates that downstream and upstream changes are created at the appropriate times (not creating upstream changesets when only downstream changes occurred, and vice versa). However, sync is a bi-directional process, and both Nodes will evaluate what changes need to be merged when a sync occurs. These tests verify the proper creation and use of changesets between two Nodes.
Sync Versioning
Each Node keeps track of its SyncReceivedVersion and SyncSentVersion. These two Node properties are used to determine when, and with who, a Node last synced. Additionally, Nodes also track a list of recent committed versions. This list can be used to obtain the previous sync version of a subscriber from a distributor (the distributor being the Node where the changes were made, and the subscriber the Node in need of the changes). The unit tests verify that this list of versions is maintained properly throughout synchronization.
Sync Scope
These tests validate the correct adherence to SyncScopes with respect to the properties of entities such as TargetItems, ResourceItems, etc. The five different SyncScopes are as follows:
- Public -> Will Sync
- Private -> Will NOT Sync
- Internal -> Syncs to internal Nodes only
- InternalDownStream -> Syncs to internal children only
- InternalUpstream -> Syncs to internal parents only
Synchronizing Target Data
Validates that TargetItems and TargetGroups only sync in one of two circumstances - always sync upstream, and only sync downstream when the NodeId matches that of the target data.
Synchronizing Task Assignments
Validates that Tasking data is correctly synced both upstream and downstream. TaskMaps will sync both ways as long as the corresponding TargetItem syncs. This is the same for TaskFilters, TaskAssignments, and dependencies. Any changes made to Tasking data, such as updates and deletes, are also synced bi-directionally between Nodes. TaskItems with protected properties are also synced, and the protected properties should return an IsProtected flag.
Synchronizing Create, Read, Update, and Delete
Validates the synchronization of CRUD operations across multiple tiers (Master -> Region -> Site 1 & 2).
Synchronizing Resource Data
Validates the correct synchronization of resource data both upstream and downstream. Resource data, such as ResourceItems, always sync upstream. However, ResourceItems will only sync downstream if they are marked as Global, or assigned to a target on a child node. The following cases are tested:
- Synchronization of ResourceItems, ResourceGroups, and ResourceAssignments both upstream and downstream when applicable.
- The correct handling of empty ResourceGroups (which should not sync).
- Synchronization of new ResourceItem properties, as well as deleted properties.
Conflict Behavior
The following Sync conflicts and corresponding resolutions are tested:
- Duplicate TargetItem name and type should rename source TargetItem
- Duplicate TargetGroup name and type should rename source TargetGroup
- Duplicate ResourceItem name and type should rename source ResourceItem
- Duplicate ResourceGroup name and type should rename source ResourceGroup
- Duplicate TargetItem property name should rename source property item
- Duplicate TargetGroup property name should rename source property item
- Duplicate ResourceItem property name should rename source property item
- Duplicate ResourceGroup property name should rename source property item
- Duplicate TaskItem should rename source item
The entity is renamed by appending a timestamp to the current name.
Synchronizing Logging
Validates the correct synchronization of logs upstream depending on log level (inclusion and exlcusion). Logs do not sync downstream.
Sync Dependency Order
Verifies proper synchronization of dependent CRUD operations (i.e inserting a TargetItem on a Node, and subsequently deleting it). Additionaly, these tests also validate that certain operations such as Delete are tracked based on the Sync version.