Skip to content

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

Merged
merged 7 commits into from
Dec 8, 2020
Merged

configure resultset size limit #1480

merged 7 commits into from
Dec 8, 2020

Conversation

swilly22
Copy link
Contributor

@swilly22 swilly22 commented Dec 6, 2020

Allow for result-set size limit to be configured, default is unlimited.

@jeffreylovitz jeffreylovitz force-pushed the limit-resultset-size branch 2 times, most recently from 01d1528 to 02d31e2 Compare December 7, 2020 19:47
@swilly22 swilly22 force-pushed the limit-resultset-size branch from 9741a77 to 73eab00 Compare December 8, 2020 09:27
src/config.c Outdated
Comment on lines 14 to 18
#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
Copy link
Contributor

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
Comment on lines 330 to 332
//----------------------------------------------------------------------
// OpenMP thread count
//----------------------------------------------------------------------
Copy link
Contributor

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
Comment on lines 30 to 31
uint thread_pool_size; // Thread count for thread pool.
uint omp_thread_count; // Maximum number of OpenMP threads.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment indentation

const char *config_name = RedisModule_StringPtrLen(argv[2], NULL);

// return entire configuration
if(config_name[0] == '*') {
Copy link
Contributor

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.

Comment on lines 61 to 62
size_t n_whitelist = 1;
Config_Option_Field whitelist[1] = { Config_RESULTSET_MAX_SIZE };
Copy link
Contributor

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;
Copy link
Contributor

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;
Copy link
Contributor

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);
Copy link
Contributor

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);
Copy link
Contributor

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.

@swilly22 swilly22 merged commit 40c2c33 into master Dec 8, 2020
@swilly22 swilly22 deleted the limit-resultset-size branch December 8, 2020 16:59
jeffreylovitz added a commit that referenced this pull request Dec 8, 2020
* 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)
swilly22 added a commit that referenced this pull request Dec 8, 2020
* 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]>
pnxguide pushed a commit to CMU-SPEED/RedisGraph that referenced this pull request Mar 22, 2023
* 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants