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

alterRetentionPolicy does not support SHARD DURATION #530

Open
technicallyfeasible opened this issue Sep 16, 2020 · 6 comments
Open

alterRetentionPolicy does not support SHARD DURATION #530

technicallyfeasible opened this issue Sep 16, 2020 · 6 comments
Labels

Comments

@technicallyfeasible
Copy link

Expected Behavior

According to the InfluxDB documentation it is supported to change the shard group duration when altering a retention policy:
ALTER RETENTION POLICY <retention_policy_name> ON <database_name> DURATION <duration> REPLICATION <n> SHARD DURATION <duration> DEFAULT
(https://docs.influxdata.com/influxdb/v1.8/query_language/manage-database/#modify-retention-policies-with-alter-retention-policy)

This leads to the problematic situation that if a retention policy has been created with a very long shard duration, it is impossible to change later since an error will be returned saying:
"retention policy duration must be greater than the shard duration"

Actual Behavior

This does not seem to be implemented in the library.

Specifications

This was tested with InfluxDB version 1.8
influx library version 5.6.3

Suggested change

I suggest to support a property shardGroupDuration for RetentionOptions as well as changing alterRetentionPolicy to something like:

    alterRetentionPolicy(name, options) {
        const q = `alter retention policy ${grammar.escape.quoted(name)} on ` +
            grammar.escape.quoted(options.database || this._defaultDB()) +
            ` duration ${options.duration} shard duration ${options.shardGroupDuration} replication ${options.replication}` +
            (options.isDefault ? " default" : "");

The function createRetentionPolicy should probably be adapted as well.

I can have a stab at creating a merge request if noone is available to implement this in a timely manner.

@stale
Copy link

stale bot commented Nov 16, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Nov 16, 2020
@technicallyfeasible
Copy link
Author

Can anyone offer some input on this issue please?

@stale stale bot removed the stale label Nov 16, 2020
@stale
Copy link

stale bot commented Jan 16, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jan 16, 2021
@technicallyfeasible
Copy link
Author

is noone interested in this or can even tell me whether this will be fixed?

@bencevans
Copy link
Member

Hi @technicallyfeasible, I'm afraid I don't have the bandwidth to look into this, I'd happily review a PR but will not be working on it myself. I'd recommend moving onto using the official InfluxDB JS Client maintained by InfluxData if you're wanting a commercially supported library. https://github.com/influxdata/influxdb-client-js

@technicallyfeasible
Copy link
Author

thanks for the reply. I will have a look at the official library. Not sure why I didn't use it in the first place but maybe it wasn't available when I started working on my project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants