Skip to content

Conversation

stanley2058
Copy link
Collaborator

set returns false if the current server is already a leader. In this PR, we get the current leader immediately after set to check if the current server is the leader.

@jackycute jackycute requested review from Copilot and Yukaii September 16, 2025 05:58
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a bug in the persistence leader acquisition check by changing the logic from relying on the Redis SET command's return value to explicitly checking if the current server became the leader after the SET operation.

  • Changed from using the return value of redis.set() to explicitly checking the current leader after the operation
  • Added a separate redis.get() call to verify if this server is now the leader
  • Maintains the same conditional logic flow while fixing the incorrect leader check

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@Yukaii Yukaii merged commit 45de275 into main Sep 16, 2025
1 check passed
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.

2 participants