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

Crdb support? #104

Closed
dezren39 opened this issue Dec 10, 2023 · 6 comments
Closed

Crdb support? #104

dezren39 opened this issue Dec 10, 2023 · 6 comments
Labels
wontfix This will not be worked on

Comments

@dezren39
Copy link

dezren39 commented Dec 10, 2023

I expect cockroachdb would probably work fine, because it uses pgx, but I wanted to ask if you had any thoughts about potential issues with using it with river. My main concern is that crdb requires transaction retry and so there are wrappers used with pgx for commit, see https://pkg.go.dev/github.com/cockroachdb/cockroach-go/crdb/crdbpgx and their ExecuteTx method. I would guess it should be fine, I can call ExecuteTx from within the job maybe, but I worry I'm missing obvious conflicts with how river may use transactions under the hood. I think there is good pairing between rivers goals and crdb, though, and so I'm hoping any potential conflicts are minor.

(pgx v5 version of that wrapper library https://pkg.go.dev/github.com/cockroachdb/cockroach-go/v2/crdb/crdbpgxv5 )

@bgentry
Copy link
Contributor

bgentry commented Dec 10, 2023

I mentioned this briefly in #56 (comment)

In short I don’t think this is something we could support and I would bet even the Cockroach Labs folks would tell you it’s not a good idea. Top among the issues is that Cockroach often requires index hints to get reasonable query performance or to make use of an index, and because this isn’t a Postgres feature we can’t augment the queries to include such hints. But even if that were solved I think it’s pretty likely this use case would trigger some gnarly performance issues.

@bgentry bgentry closed this as completed Dec 10, 2023
@bgentry bgentry added the wontfix This will not be worked on label Dec 10, 2023
@dezren39
Copy link
Author

That makes sense! Would this issue persist for any of these distributed types of things? Or could something like yugabyte eventually work OK? My understanding is it's more like regular postgres but I can imagine reasons that still won't be enough.

@danthegoodman1
Copy link

Another issue is the lack of LISTE/NOTIFY for leader election

@brandur
Copy link
Contributor

brandur commented Mar 15, 2024

Another issue is the lack of LISTE/NOTIFY for leader election

I think we'll have an answer for this one soon-ish at least. I've been working on a "poll only" mode for River that disables the LISTEN/NOTIFY infrastructure. It's actually done already, and just needs a little more testing from the client level and a way to turn it on.

@danthegoodman1
Copy link

That’s cool! I don’t know what other postgres-exclusive features might be in use though, I only mentioned that one because I stumbled across it in the docs and recalled that it’s not implemented in crdb (and probably won’t be tbh, issue was created in 2019)

@bgentry
Copy link
Contributor

bgentry commented Mar 15, 2024

I will reiterate based on my past experience with Cockroach that even if we were to somehow get River to actually function with crdb it would probably still be a bad idea to try to use it in this way 🙂

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

4 participants