Skip to content

Conversation

@YoWuwuuuw
Copy link
Contributor

Ⅰ. Describe what this PR did

Enhance the Redis registry center with metadata registration and discovery capabilities based on branch 'gsoc-2025-meta-registry'.

1. Storage Design

Survival Key: registry.redis.{cluster}_{ip:port} (String, SETEX for keep-alive, heartbeat renewal)

Metadata Key: registry.redis.{cluster}.meta_{ip:port} (Hash, HSET for key -> value, EXPIRE has the same TTL as the survival key)

Compatibility: Write two keys for instances with metadata, write one key for instances without metadata, ensuring normal operation even with client and server version mismatches.

2. Registration Process

Write the survival key first (without publishing) → Ensure its existence

Then write the metadata hash and set the TTL (set the TTL even without metadata)

Finally, publish the REGISTER event to ensure consumers can read the "with metadata" instance on the first read.

Heartbeat: During renewal, only refresh the TTL of the two keys, do not repeatedly write metadata.

3. Lookup/Subscribe:

  • Initial Load: SCAN registry.redis.{cluster}_*, directly parse {ip:port} from the key name, read the corresponding meta hash, and build... ServiceInstance (with metadata preferred)

  • Subscribe to updates: Upon receiving the REGISTER, first delete the old instance at the same address, then add the new instance (with metadata) to remove duplicates and avoid "coexistence of instances with/without metadata at the same address".

Ⅱ. Does this pull request fix one issue?

Ⅲ. Why don't you add test cases (unit test/integration test)?

Ⅳ. Describe how to verify it

Ⅴ. Special notes for reviews

@YoWuwuuuw YoWuwuuuw changed the base branch from 2.x to gsoc-2025-meta-registry October 31, 2025 09:52
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.

1 participant