-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
ea7cd33
to
a668de5
Compare
internal/wal/gen_wal_proto.sh
Outdated
# 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="." | ||
|
There was a problem hiding this comment.
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.
There was a problem hiding this 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) | ||
} |
There was a problem hiding this comment.
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?
This PR includes following:
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: