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

fix: fix wrong max age transformation from seconds #23684

Conversation

ZuperZee
Copy link
Contributor

@ZuperZee ZuperZee commented Aug 29, 2022

Required checklist

  • Sample config files updated (both /etc folder and NewDemoConfig methods) (influxdb and plutonium)
  • openapi swagger.yml updated (if modified API) - link openapi PR
  • Signed CLA (if not already signed)

Description

1-3 sentences describing the PR (or link to well written issue)

Creating a replication stream with maxAgeSeconds (following this guide https://docs.influxdata.com/influxdb/v2.4/write-data/replication/replicate-data/?t=API)
Creates a replication stream with max age in nanoseconds (100_000_000ns = 1s) which makes the maxAgeSeconds=604800 in the docs to be 0.6048ms instead of 168h

Related issue #23681

Context

Why was this added? What value does it add? What are risks/best practices?

Converts the maxAgeSeconds to be seconds instead of nanoseconds.

Affected areas (delete section if not relevant):

List of user-visible changes. As a user, what would I need to see in docs?
Examples:
CLI commands, subcommands, and flags
API changes
Configuration (sample config blocks)

A quick workaround was to add 100_000_000 to the value stored in maxAgeSeconds. Using this fix would make those 100_000_000 times longer.

Severity (delete section if not relevant)

i.e., ("recommend to upgrade immediately", "upgrade at your leisure", etc.)

Note for reviewers:

Check the semantic commit type:

  • Feat: a feature with user-visible changes
  • Fix: a bug fix that we might tell a user “upgrade to get this fix for your issue”
  • Chore: version bumps, internal doc (e.g. README) changes, code comment updates, code formatting fixes… must not be user facing (except dependency version changes)
  • Build: build script changes, CI config changes, build tool updates
  • Refactor: non-user-visible refactoring
  • Check the PR title: we should be able to put this as a one-liner in the release notes

@ZuperZee
Copy link
Contributor Author

ZuperZee commented Nov 7, 2022

Is there anything I can do to help get this merged in?

Copy link
Contributor

@jeffreyssmith2nd jeffreyssmith2nd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few small comments but looks good overall. Thanks for the contribution!

replications/internal/queue_management.go Outdated Show resolved Hide resolved
replications/internal/queue_management.go Outdated Show resolved Hide resolved
@ZuperZee
Copy link
Contributor Author

ZuperZee commented Nov 9, 2022

@jeffreyssmith2nd, I added the changes you suggested.
I can change the commits in this pr to one commit if you think it would be better.

@jeffreyssmith2nd
Copy link
Contributor

@jeffreyssmith2nd, I added the changes you suggested.
I can change the commits in this pr to one commit if you think it would be better.

Multiple commits is fine, I will do a squash merge so it'll get reduced down to one commit at the end.

@jeffreyssmith2nd jeffreyssmith2nd merged commit 666cabb into influxdata:master Nov 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

InfluxDB Replicate maxAge is wrongly calculated/handeled
2 participants