Skip to content

Keeper compatibility with ZooKeeper: Create with TTL - #79071

Closed
scanhex12 wants to merge 10 commits into
ClickHouse:masterfrom
scanhex12:create_with_ttl
Closed

scanhex12 wants to merge 10 commits into
ClickHouse:masterfrom
scanhex12:create_with_ttl

Conversation

@scanhex12

@scanhex12 scanhex12 commented Apr 12, 2025 •

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • New Feature

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Added command CreateTTL from ZooKeeper (https://zookeeper.apache.org/doc/r3.5.4-beta/zookeeperProgrammers.html#TTL+Nodes)

A node with TTL can be deleted in two ways. The first is the garbage collector - it uses a background thread to delete nodes after a certain time. But not all nodes are stored in RAM - such nodes are deleted lazily

Documentation entry for user-facing changes

  • Documentation is written (mandatory for new features)

@scanhex12
scanhex12 marked this pull request as draft April 12, 2025 17:40
@scanhex12
scanhex12 marked this pull request as ready for review April 12, 2025 20:06
@alexey-milovidov alexey-milovidov added the can be tested Allows running workflows for external contributors label Apr 12, 2025
@clickhouse-gh

clickhouse-gh Bot commented Apr 12, 2025

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [6e91063]

@clickhouse-gh clickhouse-gh Bot added the pr-feature Pull request with new product feature label Apr 12, 2025
@clickhouse-gh clickhouse-gh Bot added the manual approve Manual approve required to run CI label Apr 13, 2025
@antonio2368 antonio2368 self-assigned this Apr 14, 2025
@clickhouse-gh

clickhouse-gh Bot commented May 20, 2025

Copy link
Copy Markdown
Contributor

Dear @antonio2368, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@mstetsyuk mstetsyuk self-assigned this May 28, 2025
@clickhouse-gh

clickhouse-gh Bot commented Jul 1, 2025

Copy link
Copy Markdown
Contributor

Dear @mstetsyuk, this PR hasn't been updated for a while. You will be unassigned. Will you continue working on it? If so, please feel free to reassign yourself.

@antonio2368 antonio2368 linked an issue Jul 11, 2025 that may be closed by this pull request
@mstetsyuk mstetsyuk self-assigned this Oct 27, 2025

@mstetsyuk mstetsyuk 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.

This approach has a consistency issue.

If replicas just delete nodes locally based on their local clock without running consensus, they may disagree on the state.

Here's an example:

  • Replica A (clock +1s): deletes node /my/node at T
  • Replica B (correct clock): /my/node still exists at T
  • Replica C (correct clock): /my/node still exists at T
  • Client tries to create /my/node at T
  • Result: A says "OK", while B and C say "already exists"

I looked into the code and, apparently, ZooKeeper puts delete operations into the replication log rather than just removing them locally: one, two, three. Let's do the same, WDYT?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

can be tested Allows running workflows for external contributors manual approve Manual approve required to run CI pr-feature Pull request with new product feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for TTL of nodes in ClickHouse Keeper

4 participants