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

Panic when replicating table with large numeric #1392

Open
jscheid opened this issue Oct 16, 2024 · 0 comments
Open

Panic when replicating table with large numeric #1392

jscheid opened this issue Oct 16, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jscheid
Copy link

jscheid commented Oct 16, 2024

Describe the problem

Replicating large numeric values will cause Readyset to panic with the (counter-intuitive) error message Number less than minimum value that can be represented. (full backtrace)

To Reproduce

CREATE TABLE foo (a NUMERIC);
INSERT INTO foo (a) VALUES (154000200562066000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000::NUMERIC);

Then arrange for the table to be replicated.

Expected behavior

Your documentation states:

Readyset does not support DECIMAL/NUMERIC values with a scale greater than 28, i.e., with more than 28 digits to the right of the decimal point. 'NaN', 'Infinity', and '-Infinity' are also not supported.

This value doesn't have any digits to the right of the decimal point, but maybe your documentation needs to be more precise and say "does not support values with more than 28 digits"?

Even then, the replication shouldn't panic. Perhaps it should do one of the following instead:

  • Print an error and skip replication of the record.
  • Print an error and pause replication of the table.
  • Replace the value with a user-defined substitute.

Ideally you would also provide guidance on how to ensure that the replicated table cannot contain unsupported values in the first place, such as a CHECK constraint. (I think even more ideal would be if Readyset refuses to replicate a table without that constraint, just as it refuses to replicate one with scale out of bounds.)

Environment

  • ReadySet version [e.g., beta-2022-11-02]: stable-240919
  • ReadySet deployment method [e.g, local orchestrator, Helm chart, binaries]: binary built from source
  • Upstream database and version [e.g., Postgres 14]: Postgres 14
  • Client app [e.g., psql, mysql, SQLAlchemy, TypeORM]: psql
@jscheid jscheid added the bug Something isn't working label Oct 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant