-
Notifications
You must be signed in to change notification settings - Fork 231
configure resultset size limit #1480
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
Conversation
01d1528
to
02d31e2
Compare
9741a77
to
73eab00
Compare
src/config.c
Outdated
#define CACHE_SIZE "CACHE_SIZE" // Config param, the size of each thread cache size, per graph. | ||
#define THREAD_COUNT "THREAD_COUNT" // Config param, number of threads in thread pool | ||
#define OMP_THREAD_COUNT "OMP_THREAD_COUNT" // Config param, max number of OpenMP threads | ||
#define VKEY_MAX_ENTITY_COUNT "VKEY_MAX_ENTITY_COUNT" // Config param, max number of entities in each virtual key | ||
#define MAINTAIN_TRANSPOSED_MATRICES "MAINTAIN_TRANSPOSED_MATRICES" // Whether the module should maintain transposed relationship matrices |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why delete the comments?
src/config.c
Outdated
//---------------------------------------------------------------------- | ||
// OpenMP thread count | ||
//---------------------------------------------------------------------- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These comments should be aligned with the case
statements like cache size
is.
src/config.h
Outdated
uint thread_pool_size; // Thread count for thread pool. | ||
uint omp_thread_count; // Maximum number of OpenMP threads. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Comment indentation
src/commands/cmd_config.c
Outdated
const char *config_name = RedisModule_StringPtrLen(argv[2], NULL); | ||
|
||
// return entire configuration | ||
if(config_name[0] == '*') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think an actual strcmp
is better, as redis supports wildcard matches like *max
.
src/commands/cmd_config.c
Outdated
size_t n_whitelist = 1; | ||
Config_Option_Field whitelist[1] = { Config_RESULTSET_MAX_SIZE }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I feel like a whitelist of run-time fields would be more appropriate in config.h
.
src/config.c
Outdated
|
||
default : | ||
ASSERT("invalid option field" && false); | ||
return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tabs, not spaces.
src/config.c
Outdated
uint *omp_nthreads = va_arg(ap, uint*); | ||
va_end(ap); | ||
|
||
if(omp_nthreads == NULL) return false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These guards seem overly permissive to me. If any of these values are returned as NULL, that's an error and should be asserted on.
//---------------------------------------------------------------------- | ||
|
||
default : | ||
ASSERT("invalid option field" && false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a handled error.
src/config.c
Outdated
//---------------------------------------------------------------------- | ||
|
||
default : | ||
ASSERT("invalid option field" && false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a handled error.
* configure resultset size limit * WIP, refactored configuration * runtime config GET/SET * test resultset implicit limit * retrieve entire configuration with GRAPH.CONFIG GET * * Address PR comments Co-authored-by: Jeffrey Lovitz <[email protected]> (cherry picked from commit 40c2c33)
* configure resultset size limit (#1480) * configure resultset size limit * WIP, refactored configuration * runtime config GET/SET * test resultset implicit limit * retrieve entire configuration with GRAPH.CONFIG GET * * Address PR comments Co-authored-by: Jeffrey Lovitz <[email protected]> (cherry picked from commit 40c2c33) * bump version to 2.2.11 Co-authored-by: Roi Lipman <[email protected]>
* configure resultset size limit * WIP, refactored configuration * runtime config GET/SET * test resultset implicit limit * retrieve entire configuration with GRAPH.CONFIG GET * * Address PR comments Co-authored-by: Jeffrey Lovitz <[email protected]>
Allow for result-set size limit to be configured, default is unlimited.