Skip to content
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

Add possibility to get list of datacenters in rune scripts #101

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

vponomaryov
Copy link
Contributor

It is useful for having better flexibility running a test against a multi-dc DB clusters.

Also, share preferred_datacenter info with rune scripts.

Allow a rune script know which datacenter was set as preferred.
It may then be used in rune scripts which run against multi-dc setups.
It is useful for having better flexibility
running a test against a multi-dc DB clusters.
@pkolaczk
Copy link
Owner

Can you explain why it is useful?

And if we add that, I think we also need to expose other metadata, e.g. list of nodes, cluster name, versions, etc.
Anyways, instead of adding it to the top-level context object, maybe let's have something like connection field which would expose the metadata of the connection (and maybe also offer some less frequently used options)? I don't want to pollute the namespace of the top-level object with things that aren't frequently used.

Copy link
Owner

@pkolaczk pkolaczk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As commented above, let's introduce a connection field on context, and let's add all the connection stuff there. This is because context is not just about the connection, its responsibility is bigger, e.g. storing temporary data (not related to the database) between prepare and run step.

@vponomaryov
Copy link
Contributor Author

Can you explain why it is useful?

We have a multi-dc setup where region-specific stuff gets used in schema.
Then, a stress that gets run must be aware about the preferred datacenter if it is set for a latte command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants