Fieldpine Logo Documentation Home   DESIGN NOTES

This information is a technical design note. Use extreme caution if relying on this information, it may be outdated or incomplete

Design Note: Peer Mesh


PeerMesh is responsible for transferring complete or partial tables of data between Gds/2 servers. A HO Peer server (one that mirrors live) uses PeerMesh to maintain the replicated data

Source Code: RLSync.cpp and others

Gds/2 Peer Server

A peer server is a mirror copy of a Gds server. This might be used for redundancy or reporting purposes.

RetailLogic MeshFileMaint

Source Code: MeshFileMaint.cpp. This code is responsible for creating and loading transfer files. It is used by both PeerMesh (create and load) and SyncHidden (create only)

A number of threads are created, currently 3 by default, to handle all the internal tasks. These threads are all created at below_normal priority. Different stack sizes are used for threads and the threads select large or small tasks based on their available stack space. This essentially means that two large requests will execute sequentially on the same thread, but smaller tasks can use different threads in parallel. This was done as loading large tables can be memory and IO intensive

Load Task

Used to load a transfer file from disk to database. Source code MeshFileMaint / ApplyUpdate

  1. File presence is verified.
  2. File is checked to see if already loaded. This is a memory based check, and if already loaded a debug line 8712 is recorded with the name of the file. Loading stops.
  3. A primary key is attempted to be located if possible. Using local DMEG.f1103
  4. If the file size is larger than 350Mb, we skip out. Transfer files should not reach this size by design and should be in seperate chunks.
  5. Data is loaded. See source for exact logic/steps.

Dynamic Updating

The scheme outlined above is primary involved with full table replication. Peer mesh is also capable of handling individual single edits

  1. A mesh queue is created on /rm/RMSYSTEM/tubt/Rank/KEYOFTHEDAY
  2. When a TUBT is ready for routing, MeshRouter creates a TURI and inserts it into this queue. The from field is set to the dbid of the generator