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

configurable topology refresh duration #776

Conversation

rishabharyal
Copy link
Contributor

@rishabharyal rishabharyal commented Jul 30, 2023

This pull requests a configurable way to topology refresh duration. Two files session.rs and cluster.rs have been modified to set the session configuration and consume the duration configuration respectively.

Note: I am not sure if we need any test cases in this case as the duration is still provided from where its called.

  • I have split my patch into logically separate commits.
  • All commit messages clearly explain what they change and why.
  • I added relevant tests for new features and bug fixes.
  • All commits compile, pass static checks and pass test.
  • PR description sums up the changes and reasons why they should be introduced.
  • I have provided docstrings for the public items that I want to introduce.
  • I have adjusted the documentation in ./docs/source/.
  • I added appropriate Fixes: annotations to PR description.

Fixes: #232

… to ClusterWorker struct, which is now used instead of old creating new Dutaion instance
…h_interval of type Duration which is consumed by ClusterWorker
@rishabharyal rishabharyal changed the title Rishabharyal/configurable topology refresh duration configurable topology refresh duration Jul 30, 2023
@rishabharyal rishabharyal marked this pull request as draft July 30, 2023 17:21
@rishabharyal rishabharyal marked this pull request as ready for review July 31, 2023 08:45
Copy link
Collaborator

@piodul piodul left a comment

Choose a reason for hiding this comment

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

To be precise, the parameter that you introduced affects how frequently the whole cluster metadata is refreshed. Cluster metadata not only contains information about the cluster topology, but also information about the cluster schema. The issue #232 was created long ago, when the only metadata that the driver used to fetch in ClusterWorker::perform_refresh() was indeed cluster topology, but it has changed since.

I think the current behavior of the parameter is fine and it can control fetching of the whole metadata, but the names used in the code and in the documentation should be adjusted.

Apart from that and some other small comments - looks good.

scylla/src/transport/session_builder.rs Outdated Show resolved Hide resolved
docs/source/connecting/connecting.md Outdated Show resolved Hide resolved
@piodul
Copy link
Collaborator

piodul commented Aug 2, 2023

Note: I am not sure if we need any test cases in this case as the duration is still provided from where its called.

I don't have a good idea on how to write a good test for this. Usually, a SessionBuilder test + a manual test to see whether the parameter is properly propagated is sufficient for us.

Rishabh Aryal added 2 commits August 2, 2023 13:42
@rishabharyal
Copy link
Contributor Author

Hi @piodul, are any further changes needed? Let me know in case you missed this.

Copy link
Collaborator

@wprzytula wprzytula left a comment

Choose a reason for hiding this comment

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

There are a number of places with names still containing "topology refresh" instead of "metadata refresh". Please fix them.

docs/source/connecting/connecting.md Outdated Show resolved Hide resolved
@rishabharyal rishabharyal force-pushed the rishabharyal/configurable-topology-refresh-duration branch from 80a72bb to 3d6a177 Compare August 18, 2023 14:52
Copy link
Collaborator

@wprzytula wprzytula left a comment

Choose a reason for hiding this comment

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

Thanks, LGTM.
Whoever maintainer is going to merge this, I highly recommend squash&merge.

@piodul
Copy link
Collaborator

piodul commented Aug 22, 2023

Hi @piodul, are any further changes needed? Let me know in case you missed this.

@rishabharyal Sorry, I was out on vacation for the last two weeks.

Copy link
Collaborator

@piodul piodul left a comment

Choose a reason for hiding this comment

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

LGTM, and thanks for the contribution!

@piodul piodul merged commit e1fa6ff into scylladb:main Aug 22, 2023
9 checks passed
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.

Make the topology refresh duration configurable
3 participants