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

Removes message cloning operation required for query router #285

Merged

Conversation

zainkabani
Copy link
Contributor

The client currently needs to clone every message to determine if it is an admin command. This PR removes the need to clone and instead allows passing by reference.

Introduces the BytesMutReader trait to Cursor which helps to read null terminated chunks of strings.

@zainkabani zainkabani marked this pull request as draft January 18, 2023 02:02
@zainkabani zainkabani marked this pull request as ready for review January 19, 2023 07:57
@@ -93,7 +93,7 @@
threads = Array.new(slow_query_count) do
Thread.new do
conn = PG.connect(processes.pgcat.connection_string("sharded_db", "sharding_user"))
conn.async_exec("SELECT pg_sleep(1)")
conn.async_exec("BEGIN")
Copy link
Contributor

Choose a reason for hiding this comment

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

It's faster than sleeping, that's for sure.

Copy link
Contributor

@levkk levkk left a comment

Choose a reason for hiding this comment

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

💯

@levkk levkk merged commit ca89019 into postgresml:main Jan 19, 2023
jmeagher pushed a commit to jmeagher/pgcat that referenced this pull request Feb 17, 2023
Contains
chore(deps): bump tokio from 1.24.1 to 1.24.2 (postgresml#286)
Log error messages for network failures (postgresml#289)
Removes message cloning operation required for query router (postgresml#285)
Add more metrics to prometheus endpoint (postgresml#263)
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