I'm creating a new server group using Postgres 9.6 & 10.3 with SymmetricDS 3.9.13. I've got a successful installation in production that syncs one database server with approx. 10 slaves. This is an upgrade to that system, but I'm having issues.
The new server group uses different sync rules. I'm unable to get the token correct for Node Group ID.
From what I can tell, you have tokens in use in three places, each with different syntax (???), and not documented very well anywhere:
sym_router in the router_expression field.
sym_trigger in the external_select field, or I hope so.
sym_trigger_router in the initial_load_select field.
The documentation for the router expression field is probably okay. 3.9 lists :NODE_ID, :NODE_GROUP_ID, :EXTERNAL_ID, and :REDIRECT_NODE as acceptable tokens.
There is no documentation for external_select using tokens, but it should present as an additional field called EXTERNAL_DATA. Please correct me if I'm wrong. From my understanding it needs to return a single record with a single field. I was considering using the group.id from the engine in a function that returned the data into EXTERNAL_DATA. However, I'm guessing at the syntax for the tokens. I have not got a working example using an external_select yet. I've also tried subselect instead but nothing ever got transferred.
The documentation on initial_load_select is confusing at best, and incomplete. The naming convention changes from all caps with underscores prefixed by a colon, to Camel Case surrounded by parentheses and a $. The only working token from production I know of is $(externalId). What are the equivalents for the other tokens present in the router_expression field?
The new rules I've put together have nodes syncing based on what group they belong to, not what node_id they've been assigned. 36 character UUIDs also do work, or at least I can confirm that they do for the external.id's in production.
So far my initial loads fail because they cannot resolve a token for the Node Group ID, which I understand comes from the group.id setting in the engine file.
Any help in synchronizing by group ids is greatly appreciated.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We are always looking to improve the documentation. Please feel free to create pull requests with documentation udpates or enter an issue with suggestions (like above).
Yes, I think it would be a good idea that in the same place you mention $(externalId), that you mention the others too. I would put that in a pull request, but I've never done anything like that before, or used a CVS.
Thank you for clearing up the variables. I do understand that now, however, I notice you gave me $(groupId), and what would be implied by :NODE_GROUP_ID is $(nodeGroupId). I don't really understand why that naming convention exists in the router expression and why it so different from the naming convention described by the variables section.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm creating a new server group using Postgres 9.6 & 10.3 with SymmetricDS 3.9.13. I've got a successful installation in production that syncs one database server with approx. 10 slaves. This is an upgrade to that system, but I'm having issues.
The new server group uses different sync rules. I'm unable to get the token correct for Node Group ID.
From what I can tell, you have tokens in use in three places, each with different syntax (???), and not documented very well anywhere:
The documentation for the router expression field is probably okay. 3.9 lists :NODE_ID, :NODE_GROUP_ID, :EXTERNAL_ID, and :REDIRECT_NODE as acceptable tokens.
There is no documentation for external_select using tokens, but it should present as an additional field called EXTERNAL_DATA. Please correct me if I'm wrong. From my understanding it needs to return a single record with a single field. I was considering using the group.id from the engine in a function that returned the data into EXTERNAL_DATA. However, I'm guessing at the syntax for the tokens. I have not got a working example using an external_select yet. I've also tried subselect instead but nothing ever got transferred.
The documentation on initial_load_select is confusing at best, and incomplete. The naming convention changes from all caps with underscores prefixed by a colon, to Camel Case surrounded by parentheses and a $. The only working token from production I know of is $(externalId). What are the equivalents for the other tokens present in the router_expression field?
The new rules I've put together have nodes syncing based on what group they belong to, not what node_id they've been assigned. 36 character UUIDs also do work, or at least I can confirm that they do for the external.id's in production.
So far my initial loads fail because they cannot resolve a token for the Node Group ID, which I understand comes from the group.id setting in the engine file.
Any help in synchronizing by group ids is greatly appreciated.
I think you are looking for $(groupId)
https://github.com/JumpMind/symmetric-ds/blob/f590c705d145519763dfe97146430c69368fc5e0/symmetric-core/src/main/java/org/jumpmind/symmetric/db/AbstractTriggerTemplate.java#L239-L247
Documentation mentions it here:
http://www.symmetricds.org/doc/3.9/html/user-guide.html#_load_data
Variables are discussed here:
http://www.symmetricds.org/doc/3.9/html/user-guide.html#_variables
We are always looking to improve the documentation. Please feel free to create pull requests with documentation udpates or enter an issue with suggestions (like above).
Here is where documentation is on github:
https://github.com/JumpMind/symmetric-ds/tree/3.9/symmetric-assemble/src/asciidoc
Thank you Chris.
Yes, I think it would be a good idea that in the same place you mention $(externalId), that you mention the others too. I would put that in a pull request, but I've never done anything like that before, or used a CVS.
Thank you for clearing up the variables. I do understand that now, however, I notice you gave me $(groupId), and what would be implied by :NODE_GROUP_ID is $(nodeGroupId). I don't really understand why that naming convention exists in the router expression and why it so different from the naming convention described by the variables section.