<@U078Y59KC3B> When does an entry ID have an negat...
# ask-ai
t
@RunLLM When does an entry ID have an negative value?
r
Entry IDs in BookKeeper and Pulsar are expected to be non-negative; negative entry IDs are considered invalid and typically indicate an error or special condition, such as "no entry" or "no data" in a ledger. For example, -1 is often used to represent an invalid or uninitialized entry ID, or to signal that a ledger is empty or has no confirmed entries yet. This is not a valid entry and should not occur during normal operation—entry IDs are guaranteed to be consecutively auto-incrementing and non-negative within a ledger according to BookKeeper documentation and BookKeeper issue #4671. Negative entry IDs may also appear in logs or APIs to indicate special states, such as when a consumer queries the last message ID and the result is X:-1, meaning there is no data in the topic, or during recovery when a ledger is empty (Pulsar PR #16299). Would you like more detail or examples of where negative entry IDs are used in code or logs? Sources: - BookKeeper 4.16.7 Advanced Ledger API - Pulsar PR #16299 - BookKeeper issue #4671 👍 0 button 👎 0 button 💡 Hint: Mention @runllm in the thread for followups.