-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
master: Alpha stops running when querying for invalid datetime value. #3166
Comments
We accept empty string value, which is converted to zero time value datetime. For some reason this empty string was not converted, that's the bug. |
We are saving the zero-time value, but we then marshal to binary which converts it to |
In v1.0.13 empty values weren't accepted as a mutation. It was an error. Are we changing the behavior so that the mutation is accepted and the data is converted internally? |
Yes, empty strings will be converted internally to zero-time value. So it looks like we were missing a case for this. |
Empty string should be rejected for a datetime, shouldn't it? It is not a valid datetime. |
That was the old behavior that we changed to fix an issue with exports. We allow empty string as datetime and internally convert them to zero-times. So empty strings are now handled transparently with all types. |
I still think that empty string as a datetime should have been rejected during mutation. Why does an export (read path) cause an issue with a mutation (write path)? |
@manishrjain As you and I discussed just now, I'm going to remove the code that handles default conversions. That should trigger an error if a mutation is tried with unsupported values. So the empty string mutation on datetime will trigger an error instead of Dgraph try to handle it. |
What version of Dgraph are you using?
master.
Have you tried reproducing the issue with latest release?
This does not happen in v1.0.
Steps to reproduce the issue (command/config used to run Dgraph).
curl localhost:8080/alter -d 'pred.date: datetime .'
Alpha shows this error log and stops running:
The query never succeeds since the Alpha stopped after receiving the query.
Expected behaviour and actual result.
Dgraph shouldn't accept invalid data. In v1.0.13 (latest), the mutation does not succeed since "" is an invalid datetime format.
The text was updated successfully, but these errors were encountered: