GoLang File Server
A GoLang server implements a multi-client / multi-threaded file system server with transactional semantics.
My contributions were:
- Design and implement the functionality of reading and writing of files.
- Implemented all code for transaction commands. The description of these commands is seen below under The Inspiration and Problem section.
- Ensured that commands would handle omission, byzantine and failstop failures on the client and
failstop failures on the server.
The Inspiration and Problem
I wanted to learn how to use GoLang and wanted to build a multi-client / multi-threaded
file system server with
transactional semantics.
Since GoLang is a fantastic serverside language that essentially handles multi-threading by itself, I
really wanted to learn how to use it and leverage its amazing capabilities!
This server supports the following commands:
- READ - the client reads the file from the server. In that case, the transaction ID can be set to
any number, as it will not be interpreted by the server: reads are not part of any transaction. The
content-length field will contain the length of the file name. The data field will contain the file
name itself. For this assignment you should assume that file names contain no spaces.
- NEW_TXN - the client asks the server to begin a new transaction
- WRITE - the client asks the server to write data as part of an existing transaction
- COMMIT - the client asks the server to commit the transaction. In this case, the message sequence
number field includes the total number of writes that were sent by the client as part of this
transaction.
- ABORT - the client asks the server to abort the transaction
- ACK - the server acknowledges the committed transaction to the client or indicates a successful
response to the client's NEW_TXN request.
- ASK_RESEND - the server asks the client to resend a message for the given transaction whose
sequence number is specified in the "message sequence number" field
- ERROR - the server reports an error to the client. The error code and the ID of the transaction
that
generated the error must be included in the appropriate fields in the message
The System and Technologies
The application is built in GoLang
Challenges we ran into
Ensuring that the server would handle omission, byzantine and failstop failures on the client and failstop
failures on the server.