This repository has been archived by the owner on Nov 20, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes significant updates to the banking system project, focusing on improving concurrency control, ensuring idempotence of operations, and enhancing documentation. The most important changes include adding request IDs to ensure idempotence, implementing mutexes for concurrency control, and updating the documentation to reflect these changes.
Improvements to concurrency control and idempotence:
src/Client/ATM/ATM.go
: AddedRequestID
toAccountAccessRequest
andFundsOperationRequest
structs to ensure idempotence. UpdatedWithdraw
,Deposit
, andCheckBalance
functions to includerequestID
parameter. [1] [2] [3]src/Client/BankBranch/BankBranch.go
: AddedRequestID
to request structs and included debug print statements for request details. [1] [2]src/Client/Client.go
: Introduced a mutex in themain
function to ensure thread-safe operations when sending requests to the server. [1] [2]src/Server/Bank/Bank.go
: Updated various methods to log and checkRequestID
for idempotence, includingInitialize
,OpenAccount
,CloseAccount
,Withdraw
,Deposit
, andPeekBalance
. [1] [2] [3] [4] [5] [6] [7]Documentation updates:
docs/main.tex
: Expanded the introduction and architecture sections to detail the modular design of the banking system, the use of RPC for client-server communication, and the implementation of concurrency control and idempotence. Added sections on concurrency control, idempotence, and testing results.Additional changes and fixes:
src/Client/Menu/Menu.go
: Added input validation to ensure account ID is not zero. [1] [2]src/Server/Bank/bank_test.go
: Adjusted test case to reflect the correct initial account ID after changes tonextID
initialization.src/Server/Server.go
: Removed outdated comments regarding thread safety and idempotence.