Skip to content

Conversation

@kjnilsson
Copy link
Contributor

@kjnilsson kjnilsson commented Nov 14, 2022

There are two main changes in this PR:

  1. Make stream ids (osiris:name()) support binaries in addition to string lists and use binaries internally.
  2. Scheduled re-evaluation of max_age retention specs to ensure streams with multiple segments that eventually grow beyond max_age are truncated even if there is no incoming writes. This is configurable using a new application setting retention_eval_interval in milliseconds. The default is 1hr. Very small intervals would most likely have unacceptable resource use but there is no lower bound. This also checks that the process that requested retention eval is alive when the request is due to be processed as we won't be able to update the first offset atomic value for streams that have been restarted.

Fixes #107

@kjnilsson kjnilsson marked this pull request as ready for review November 14, 2022 17:06
@kjnilsson kjnilsson changed the title Scheduled retention eval Scheduled retention re-evaluation for max_age configured streams Nov 14, 2022
so that we can stop using list strings for stuff like stream names

Make sure stop and delete servers handle both name formats.

Also normalise Name to binary inside writer and replica.
This implements periodic re-evaluation of max_age retention specificions
so that streams that have little activity but more than one segments will
evantually be truncated.

Only schedule retention eval if there are multiple segments remaining
Else the passed shared atomic value will be invalid and the first offset
won't match the actual first offset available.
@kjnilsson kjnilsson force-pushed the scheduled-retention-eval branch from 83254a4 to 8c7db3d Compare November 14, 2022 17:16
@acogoluegnes acogoluegnes added this to the 1.4.0 milestone Nov 17, 2022
@acogoluegnes acogoluegnes merged commit c744a0f into main Nov 17, 2022
@acogoluegnes acogoluegnes deleted the scheduled-retention-eval branch November 17, 2022 15:02
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.

Periodically evaluate retention for stream with a time based retention configuration.

3 participants