Add new chunk hashes to the cs_add_list when creating or updating them in the chunk server
This commit is contained in:
@@ -1,2 +1,3 @@
|
|||||||
Notes on simulation testing:
|
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
|
- Trace the branch coverage of the test and find why some branches are never reached
|
||||||
|
|||||||
@@ -553,6 +553,7 @@ process_metadata_server_auth_response(ChunkServer *state, int conn_idx, ByteView
|
|||||||
}
|
}
|
||||||
|
|
||||||
directory_scanner_free(&scanner);
|
directory_scanner_free(&scanner);
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@@ -686,6 +687,10 @@ process_client_create_chunk(ChunkServer *state, int conn_idx, ByteView msg)
|
|||||||
|
|
||||||
sys_free(mem);
|
sys_free(mem);
|
||||||
|
|
||||||
|
if (hash_set_insert(&state->cs_add_list, new_hash) < 0) {
|
||||||
|
assert(0); // TODO
|
||||||
|
}
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
return send_error(&state->tcp, conn_idx, false, MESSAGE_TYPE_CREATE_CHUNK_ERROR, S("I/O error"));
|
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)
|
if (ret < 0)
|
||||||
return send_error(&state->tcp, conn_idx, false, MESSAGE_TYPE_UPLOAD_CHUNK_ERROR, S("I/O error"));
|
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;
|
MessageWriter writer;
|
||||||
|
|
||||||
ByteQueue *output = tcp_output_buffer(&state->tcp, conn_idx);
|
ByteQueue *output = tcp_output_buffer(&state->tcp, conn_idx);
|
||||||
|
|||||||
@@ -798,8 +798,6 @@ static int process_chunk_server_sync(MetadataServer *state,
|
|||||||
if (!file_tree_uses_hash(&state->file_tree, hash))
|
if (!file_tree_uses_hash(&state->file_tree, hash))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// TODO: execution never reaches this point for some reason
|
|
||||||
|
|
||||||
// If the chunk is properly replicated or under-replicated,
|
// If the chunk is properly replicated or under-replicated,
|
||||||
// add it to the ms_add_list.
|
// add it to the ms_add_list.
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user