XSETID(3valkey)

πŸ“¦
version 9.0.6 Β· 2 versions
, in fedora 44

πŸ’– XSETID (valkey manual, section 3) πŸ’–

okay bestie, gather round, because this one is not the command you casually type into your terminal. it's the backstage pass of the stream world. ✨


🌸 NAME 🌸

xsetid β€” an internal command for replicating stream values. lowkey mysterious, highkey important. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

XSETID key last-id [ENTRIESADDED entries-added] [MAXDELETEDID
max-deleted-id]

that's it. that's the whole vibe. two optional arguments, one big responsibility.


πŸ‘‘ DESCRIPTION πŸ‘‘

so like, the XSETID command is an internal command. it's not here for you to play with, it's here for the machinery. 🫢

a Valkey primary uses it to replicate the last delivered ID of streams. that's the whole job. it's giving "I work behind the scenes and I never get credit" energy, and honestly? iconic. πŸ‘‘


πŸ’Œ REPLY πŸ’Œ

valkey-protocol(7) Simple string reply: OK.

yeah. that's it. she says OK and moves on with her life. no notes. πŸŽ€


⭐ COMPLEXITY ⭐

O(1)

constant time, bestie. instant. no cap. πŸ”₯


🌈 ACL CATEGORIES 🌈

  • @fast
  • @stream
  • @write

three little tags, all of them slaying. πŸ’œ


πŸ•°οΈ HISTORY πŸ•°οΈ

  • Available since: 5.0.0 ✨
  • Changed in 7.0.0: Added the entries_added and max_deleted_entry_id arguments.

she got a glow-up in 7.0.0 and honestly the upgrade ate. πŸ’…


πŸ“ SEE ALSO πŸ“

the whole stream bestie squad, fr fr:

go read them all, i'll wait. 🧚


real talk though: this is an internal command. if you're reaching for it in your app code, bestie, step back. it exists for the primary to replicate stream state, and messing with it is not the main character move you think it is. πŸ™ˆ

okay that's the whole page!! version 9.0.0, dated 2025-10-21, straight from the valkey manual, rewritten with love and glitter by your favorite unix bestie. stay slay, keep your streams synced, and don't touch internal commands unless you know exactly what you're doing. mwah πŸ’–πŸŒΈπŸ¦‹βœ¨

πŸ“¦ where this page comes from