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

All shard names must be integers #195

Open
rossi-jeff opened this issue Jul 23, 2018 · 8 comments
Open

All shard names must be integers #195

rossi-jeff opened this issue Jul 23, 2018 · 8 comments

Comments

@rossi-jeff
Copy link

my first reaction was 'what??'

trying to evaluate your gem as a replacement for octopus which does not work with rails 5.2

is it possible to use named shards without forking the gem?

@vaibhavpaliwal
Copy link

Yes, its possible.. in my project we use guids something like below:

  shards:
    asdd13-c755-478d-b343-sdf900203:
      database: test
    asddw-123451-484e-b0d3-uahf2738:
      database: abc

@rossi-jeff
Copy link
Author

rossi-jeff commented Jul 24, 2018

did you need to comment out any checks in order to do that?

shards:
     alpha:
         database: db1
     beta:
        database: db2

and got the above error

@holmes2
Copy link

holmes2 commented Aug 17, 2020

I am still getting the error when my shard names are uuids. Any possible explanation on how to get around the issue ?

@grosser
Copy link
Contributor

grosser commented Aug 17, 2020

try opening up the gem and see where the validation comes from, then try to disable it ... best as opt-in

@holmes2
Copy link

holmes2 commented Aug 17, 2020

@grosser
Can i open up PR for it on the repo ? Is that something which the gem would also benefit from the changes which I make ?

@grosser
Copy link
Contributor

grosser commented Aug 17, 2020

with opening up the gem I meant bundle open active_record_shards to poke around in it / find the error location
but yeah, please open a PR here if you know what needs to change

@holmes2
Copy link

holmes2 commented Aug 19, 2020

@grosser I have tried to only comment out the checks and see if that works in the rails service. On initial test it was working fine. Other than the integer checks is there any other place where the gem assumes integers and fails ? I can try to find in the gem rspecs but needed some guidance into what might be get messed up in the gem if i provide strings.

@grosser
Copy link
Contributor

grosser commented Aug 19, 2020 via email

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

4 participants