diff --git a/SIMTEST.txt b/SIMTEST.txt index fecb209..d7db9b3 100644 --- a/SIMTEST.txt +++ b/SIMTEST.txt @@ -1,2 +1,3 @@ Notes on simulation testing: + - Make sure your program works without fault injections - Trace the branch coverage of the test and find why some branches are never reached diff --git a/src/chunk_server.c b/src/chunk_server.c index 6eee73a..2af7873 100644 --- a/src/chunk_server.c +++ b/src/chunk_server.c @@ -553,6 +553,7 @@ process_metadata_server_auth_response(ChunkServer *state, int conn_idx, ByteView } directory_scanner_free(&scanner); + return 0; } static int @@ -686,6 +687,10 @@ process_client_create_chunk(ChunkServer *state, int conn_idx, ByteView msg) sys_free(mem); + if (hash_set_insert(&state->cs_add_list, new_hash) < 0) { + assert(0); // TODO + } + if (ret < 0) return send_error(&state->tcp, conn_idx, false, MESSAGE_TYPE_CREATE_CHUNK_ERROR, S("I/O error")); @@ -737,6 +742,10 @@ process_client_upload_chunk(ChunkServer *state, int conn_idx, ByteView msg) if (ret < 0) return send_error(&state->tcp, conn_idx, false, MESSAGE_TYPE_UPLOAD_CHUNK_ERROR, S("I/O error")); + if (hash_set_insert(&state->cs_add_list, new_hash) < 0) { + assert(0); // TODO + } + MessageWriter writer; ByteQueue *output = tcp_output_buffer(&state->tcp, conn_idx); diff --git a/src/metadata_server.c b/src/metadata_server.c index b2f5324..ce63de0 100644 --- a/src/metadata_server.c +++ b/src/metadata_server.c @@ -798,8 +798,6 @@ static int process_chunk_server_sync(MetadataServer *state, if (!file_tree_uses_hash(&state->file_tree, hash)) continue; - // TODO: execution never reaches this point for some reason - // If the chunk is properly replicated or under-replicated, // add it to the ms_add_list.