-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/read transaction for non rmw commands #440
Feature/read transaction for non rmw commands #440
Conversation
…get, set, delete, iter, get_key and get_random_key operations
…n interacting with the storage db
|
||
// Drops the increment and retry | ||
bucket_index -= increment; | ||
keys_eviction_candidates_list_count--; |
Check notice
Code scanning / CodeQL
For loop variable changed in body Note
loop
storage_db_entry_index_t *entry_index = NULL; | ||
if (!hashtable_mcmp_op_get_by_index( | ||
db->hashtable, | ||
database_number, |
Check failure
Code scanning / CodeQL
Potentially uninitialized local variable High
database_number
Show autofix suggestion
Hide autofix suggestion
Copilot Autofix AI 2 months ago
To fix the problem, we need to ensure that database_number
is initialized before it is used. The best way to fix this without changing existing functionality is to initialize database_number
to a default value at the point of declaration. This ensures that it has a defined value when it is used later in the code.
-
Copy modified line R943
@@ -942,3 +942,3 @@ | ||
bucket_index++) { | ||
storage_db_database_number_t database_number; | ||
storage_db_database_number_t database_number = 0; | ||
char *key = NULL; |
A set of commands need to be updated to use the new transaction model, now to modify an entry after a read lock has been issued requires upgrading the lock to a write lock. This change will be implemented with a separated PR, until then some commands will be broken. The security issue is coming off a different, older, PR and will be fixed with an ad hoc PR. |
This pull request introduces transaction management improvements to several benchmark operations in the hashtable implementation. The changes ensure that transactions are properly acquired and released during various operations, enhancing the consistency and reliability of the hashtable.
The change is partial and to be revised with a different PR.
Transaction management improvements:
benches/bench-hashtable-mpmc-op-get.cpp
: Added transaction acquisition and release inhashtable_op_get_not_found_key
andhashtable_op_get_single_key_external
functions to ensure proper transaction handling. [1] [2]benches/bench-hashtable-mpmc-op-set.cpp
: Incorporated transaction management inhashtable_op_set_insert
andhashtable_op_set_update
functions to maintain transaction integrity during set and update operations. [1] [2] [3] [4] [5]Function signature updates:
src/data_structures/hashtable/mcmp/hashtable_op_delete.c
andhashtable_op_delete.h
: Modified function signatures to includetransaction_t
parameters, ensuring transactions are passed and managed correctly. [1] [2] [3]src/data_structures/hashtable/mcmp/hashtable_op_get.c
: Updated thehashtable_mcmp_op_get
function to accept atransaction_t
parameter, facilitating proper transaction management.Code cleanup and consistency:
src/data_structures/hashtable/mcmp/hashtable.h
: Removed unnecessary transaction member fromhashtable_mcmp_op_rmw_transaction
structure and added a new macro definitionHASHTABLE_OP_ITER_END
. [1] [2]