Skip to content

feat(wal): wal support for ironhawk server #1708

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 24, 2025

Conversation

AshwinKul28
Copy link
Contributor

This PR includes following:

  1. Added Support of WAL and Replay into the ironhawk server
  2. Fixed few bugs where permission denied to create/open wal file eventually goes into the panic state
  3. Error Handling from the wal package
  4. Updates to the WAL Entry format

Few Pointers to consider while adding WAL into ironhawk

Have added WAL into the ironhawk server rather than ShardManager because of the following reasons:

  • The ShardManager is responsible for managing data shards and their operations

  • The Ironhawk server is responsible for handling network connections and command processing

  • WAL is more closely related to command processing and persistence at the server level

  • The ShardManager is a lower-level component that shouldn't need to know about persistence mechanisms

  • The Ironhawk server is the higher-level component that coordinates between different parts of the system

  • WAL is a server-level feature that should be managed by the server component


Summary:

  1. Add WAL entries
Screenshot 2025-03-30 at 11 33 03 PM
  1. WAL Replay
Screenshot 2025-03-30 at 11 32 21 PM

@AshwinKul28 AshwinKul28 force-pushed the master branch 2 times, most recently from ea7cd33 to a668de5 Compare April 26, 2025 20:12
Comment on lines 6 to 15
# Define the directory where the proto file will be downloaded
PROTO_DIR=$(dirname "$0")
OUTPUT_DIR="$PROTO_DIR"

# Define the proto file and the output file
# Define the GitHub repository and file path
GITHUB_REPO="AshwinKul28/dicedb-protos"
GITHUB_BRANCH="patch-1"
PROTO_FILE_PATH="wal/wal.proto"
PROTO_FILE="$PROTO_DIR/wal.proto"
OUTPUT_DIR="."

Copy link
Contributor

Choose a reason for hiding this comment

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

OUr protos dependency is taken through dicedb-go package which takes it from dicedb-protos. We need not be doing this here. The generates WAL protos can be part of dicedb-go.

Copy link
Contributor

@arpitbbhayani arpitbbhayani left a comment

Choose a reason for hiding this comment

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

Overall looks good. Just need to move the protos changes to dicedb-go

return fmt.Errorf("failed to marshal command payload: %w", err)
}

return wal.writeEntry(payloadBytes)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What happens if lsn is incremented and assigned but the writeEntry returns an error. Won't WAL have entries with skipped LSN in this case. Is this fine as long as LSN is incrementing or should we check for error here?

@arpitbbhayani arpitbbhayani merged commit 9c2c597 into DiceDB:master May 24, 2025
2 checks 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.

3 participants