Skip to content

[ADDED] KeyValue per key TTL support and limit markers - #1864

Merged
piotrpio merged 3 commits into
mainfrom
add-kv-per-msg-ttl
May 2, 2025
Merged

[ADDED] KeyValue per key TTL support and limit markers#1864
piotrpio merged 3 commits into
mainfrom
add-kv-per-msg-ttl

Conversation

@piotrpio

Copy link
Copy Markdown
Collaborator

Added:

  1. LimitMarkerTTL config option to enable automatic tombstone deletion.
  2. KeyTTL option to kv.Create()
  3. PurgeTTL option to kv.Purge()

Signed-off-by: Piotr Piotrowski piotr@synadia.com

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio
piotrpio requested a review from Jarema April 24, 2025 12:21
@coveralls

coveralls commented Apr 24, 2025

Copy link
Copy Markdown

Coverage Status

coverage: 84.66% (-0.05%) from 84.705%
when pulling 2127c16 on add-kv-per-msg-ttl
into d1cdbf5 on main.

@piotrpio
piotrpio marked this pull request as ready for review April 28, 2025 08:39

@Jarema Jarema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

some comments and questions.

Comment thread jetstream/kv.go Outdated
Comment thread jetstream/kv.go
Comment thread jetstream/kv.go
case kvpurge:
op = KeyValuePurge
}
} else if m.Header.Get(MarkerReasonHeader) != "" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

are we 100% sure we should treat those the same as headers?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I was following ADR here: https://github.com/nats-io/nats-architecture-and-design/blob/main/adr/ADR-48.md#retrieving-values

But I think that makes sense, this marks the same set of KV operations, only different mechanisms.

Signed-off-by: Piotr Piotrowski <piotr@synadia.com>
@piotrpio
piotrpio requested a review from Jarema April 30, 2025 09:41

@Jarema Jarema left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM!

@piotrpio
piotrpio merged commit c93af50 into main May 2, 2025
@piotrpio
piotrpio deleted the add-kv-per-msg-ttl branch May 2, 2025 07:32
@piotrpio piotrpio mentioned this pull request May 2, 2025
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.

3 participants