From a082f46b78405987fffa782c07f46f8262eac28b Mon Sep 17 00:00:00 2001 From: Francesco Cozzuto Date: Wed, 3 Dec 2025 19:12:35 +0100 Subject: [PATCH] Update TODO.txt --- misc/TODO.txt | 8 ++++---- src/file_tree.c | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/misc/TODO.txt b/misc/TODO.txt index 09572b5..3407cca 100644 --- a/misc/TODO.txt +++ b/misc/TODO.txt @@ -1,11 +1,11 @@ [X] Implement proper operation handles that allow users to wait for specific events [X] Implement metadata server WAL +[X] Check that the corner case where read and writes go over the length of the file work correctly +[X] Return the number of bytes read or written in the ToastyFS_Result struct +[X] Add a change counter to FileTree. The counter is initialized to 0 and updated any time the tree is changed. When a new file is created, the current change counter is assigned to it. This makes it possible to verify that the file didn't change in between read and write operations without that clumsy previous hash list and previous chunk size. [ ] Clean up the read operation for clients -[ ] Check that the corner case where read and writes go over the length of the file work correctly -[ ] Return the number of bytes read or written in the ToastyFS_Result struct [ ] Make parallel uploads/downloads configurable [ ] Recalculate next write locations whenever a write occurs, not at each read -[ ] avoid replay attacks [ ] add logging (when chunk servers connect and disconnect to the metadata server) [ ] Should list scenarios that need testing, like those where chunks would be dropped [ ] Update DESIGN.txt and the code to remove the chunk list message. The information of chunks held by chunk servers is now transmitted to the metadata server during state updates @@ -17,10 +17,10 @@ [ ] Add notes on who inspired the testing approach [ ] Add notes on benchmarks and that we don't do batching [ ] Fix endianess when writing to network and the WAL -[ ] Add a change counter to FileTree. The counter is initialized to 0 and updated any time the tree is changed. When a new file is created, the current change counter is assigned to it. This makes it possible to verify that the file didn't change in between read and write operations without that clumsy previous hash list and previous chunk size. [ ] WAL entry checksum [ ] Check write() errors when appending WAL entries [ ] When WAL entries are partially written, remove partial data and fail [ ] Find a way to ensure listing operations of large directories are handled [ ] What happens if a client adds a chunk such that the hash already exists in the system? The client doesn't know it exists already. Will this lead to over-replication? [ ] Rename generation counters to version numbers +[ ] Add a flag for write operations to create the file if it doesn't exist alraedy diff --git a/src/file_tree.c b/src/file_tree.c index 65a2d2e..1c65f24 100644 --- a/src/file_tree.c +++ b/src/file_tree.c @@ -359,15 +359,19 @@ int file_tree_delete_entity(FileTree *ft, string path, return 0; } -int file_tree_write(FileTree *ft, string path, - uint64_t off, uint64_t len, uint32_t num_chunks, - uint64_t expect_gen, - uint64_t *new_gen, - SHA256 *hashes, - SHA256 *removed_hashes, - int *num_removed) +int file_tree_write( + FileTree* ft, + string path, + uint64_t off, + uint64_t len, + uint32_t num_chunks, + uint64_t expect_gen, + uint64_t* new_gen, + SHA256* hashes, + SHA256* removed_hashes, + int* num_removed) { - // Per protocol spec, WRITE operations cannot use expect_gen=0 + // WRITE operations cannot use expect_gen=0 if (expect_gen == NO_GENERATION) return FILETREE_BADGEN;