-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generate Unique EcChronos ID #678 #713
base: agent/master
Are you sure you want to change the base?
Conversation
- Generate eccrhonos_Id that should be unique (uuid + host name) - on start up instance, first check nodes_metadata table for ecchronosId, if it already exists, use that one, otherwise generate now one. - So due to persistence of eccronosId, it would be same even instance get reinstalled or restart. - when instance try to acquire nodes then add this newly ecchronosId into nodes_metadata table with datacenter and nodeId. - The new table nodes_metadata schenma, datacenter is partition key and nodeId is clustering colum and ecchrons_id coulum would hold the Id.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing updates on docs
@@ -64,7 +64,6 @@ public class BeanConfigurator | |||
private final AtomicReference<Security.CqlSecurity> cqlSecurity = new AtomicReference<>(); | |||
private final AtomicReference<Security.JmxSecurity> jmxSecurity = new AtomicReference<>(); | |||
private final ConfigRefresher configRefresher; | |||
private final String ecChronosID; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Idk about removing it, because we need to generate this ans pass for EccNodeMetadata if the instance is new, I think here we need to have some validation using the EccNodeMetadata, generate the unique id, and them passing for EccNodesSync
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.bindMarker; | ||
import static com.datastax.oss.driver.api.querybuilder.QueryBuilder.selectFrom; | ||
|
||
public final class EccNodeMetadata |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
EccNodesMetadata
public EccNodeMetadata(final List<Node> nodes, final CqlSession session) | ||
{ | ||
mySession = session; | ||
myNode = nodes.stream().findAny().get(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happens if the topology changes and you get a node that was not on the first configuration for a instance that was working?
let's say that in the configuration we are using datacenterAware, so we have a datacenter list of [d1, dc2] but now the topology changed and we added dc3 on the list, but it was not on the previously topology for this instance, so if this line picks up a node from dc3 it will generate a new ecchronos id for a instance that already has an ID
here is first idea to generate and persist unique id for ecchronos id that is partition key for other nodes_sync table.