Skip to content

selected wrong shard and the connection keep reporting fatal #80

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

Closed
DeoLeung opened this issue Jun 22, 2022 · 5 comments
Closed

selected wrong shard and the connection keep reporting fatal #80

DeoLeung opened this issue Jun 22, 2022 · 5 comments

Comments

@DeoLeung
Copy link

Describe the bug
selected wrong shard and the connection keep reporting fatal

To Reproduce

  • create 2 shards, naming shard 0 and 1
  • in a db ide, open a session
  • SET shard TO '2';, it reports FATAL: shard 2 is more than configured 2
  • SET shard TO '0';, it reports FATAL: shard 2 is more than configured 2

Expected behavior
be able to set shard to 0 and 1 after setting a wrong one

@levkk
Copy link
Contributor

levkk commented Jun 22, 2022

Thanks for reporting. Could you provide a full example in SQL that I can run on my end? I'm unable to reproduce the bug currently with the above instructions.

@DeoLeung
Copy link
Author

hmmm...I can't reproduce it either...I think it may partially relate to #81

  • restart pgcat
  • open my postico ide
  • type SET SHARD TO '2'; , it's now reporting ERROR: unrecognized configuration parameter "shard" even if i capitalize them.
  • and I'm using the config from circleci with only user and shards modified

image

@levkk
Copy link
Contributor

levkk commented Jun 22, 2022

Yup, Postico opens a transaction automatically and won't work here. I think you can disable that feature or use psql instead.

@DeoLeung
Copy link
Author

seems no config for that, I'll report to postico then :)

@levkk
Copy link
Contributor

levkk commented Jun 23, 2022

I found the bug you originally saw I think and fixing it in #84 . It's subtle, so very good find, thank you!

levkk added a commit that referenced this issue Jun 24, 2022
* Support reloading the entire config (including sharding logic) without restart.

* Fix bug incorrectly handing error reporting when the shard is set incorrectly via SET SHARD TO command.
selected wrong shard and the connection keep reporting fatal #80.

* Fix total_received and avg_recv admin database statistics.

* Enabling the query parser by default.

* More tests.
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

No branches or pull requests

2 participants