-
Notifications
You must be signed in to change notification settings - Fork 24
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
feat: port delete
from influxdb
#98
Conversation
if !params.BucketID.Valid() && params.BucketName == "" { | ||
return ErrMustSpecifyBucket | ||
} | ||
start, err := time.Parse(time.RFC3339Nano, params.Start) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a couple synapses connect while thinking through the time parsing. A while back I worked on this: influxdata/influxdb#21369 - which added a range of allowable start and stop times that the /api/v2/delete
API endpoint. When you get into the inner workings of the OSS storage engine the dates get converted to unix time and there can be some weird stuff happening if the dates are outside a (admittedly ridiculous) timeframe.
So I'm wondering what happens if you send dates outside this time range via the CLI to the OSS API. I guess you'd get an error response that the CLI would display? That would probably be alright. Or do you need to prevent invalid time ranges on the CLI...and how that might work with cloud, since I don't know if that API has similar limitations.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good thought, looks like a decent UX to me:
$ ./bin/darwin/influx delete --bucket dan --start '1677-09-21T00:12:42Z' --stop '2020-01-01T00:00:00Z'
Error: failed to delete data: invalid request; error parsing request json: invalid start time, start time must not be before 1677-09-21T00:12:43.145224194Z
$ ./bin/darwin/influx delete --bucket dan --start '2020-01-01T00:00:00Z' --stop '2262-04-11T23:47:17Z'
Error: failed to delete data: invalid request; error parsing request json: invalid stop time, stop time must not be after 2262-04-11T23:47:16.854775806Z
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good deal, that does seem to convey the right message.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Closes #11