-
Notifications
You must be signed in to change notification settings - Fork 335
[MOD-5769] Open RedisJSON key with flags #1095
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
@oshadmi do we need a new LLAPI version here? |
@@ -81,7 +81,7 @@ commands: | |||
parameters: | |||
redis_version: | |||
type: string | |||
default: "7" | |||
default: "7.2" |
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 7
mean latest 7.x
, so when there is 7.4
, for example, it would get it.
If we specifically change it to be 7.2
, it would not get 7.4
, or greater, unless we commit a change.
redis_json/src/include/rejson_api.h
Outdated
@@ -37,6 +37,7 @@ typedef struct RedisJSONAPI { | |||
/* RedisJSON functions */ | |||
RedisJSON (*openKey)(RedisModuleCtx *ctx, RedisModuleString *key_name); | |||
RedisJSON (*openKeyFromStr)(RedisModuleCtx *ctx, const char *path); | |||
RedisJSON (*openKey_withFlags)(RedisModuleCtx *ctx, RedisModuleString *key_name, int flags); |
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.
Need to increment API version
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #1095 +/- ##
==========================================
- Coverage 79.18% 78.38% -0.80%
==========================================
Files 15 15
Lines 3853 3873 +20
==========================================
- Hits 3051 3036 -15
- Misses 802 837 +35
☔ View full report in Codecov by Sentry. |
@@ -25,9 +25,11 @@ ijson.workspace = true | |||
serde_json.workspace = true | |||
serde.workspace = true | |||
libc = "0.2" | |||
redis-module = "2.0" | |||
redis-module ={ version = "^2.0.7", default-features = false, features = ["min-redis-compatibility-version-7-2"] } |
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.
No need to work on version less than 7.2?
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.
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.
we should consider attainment with the min grouped feature set. So, should follow 7, in this case, and be back-ported also for the preview version, but it won't be JSON 2.6, but 2.4
static REDISJSON_GETAPI_V3: &str = concat!("RedisJSON_V3", "\0"); | ||
static REDISJSON_GETAPI_V4: &str = concat!("RedisJSON_V4", "\0"); | ||
// The apiname argument of export_shared_api should be a string literal with static lifetime | ||
static mut VEC_EXPORT_SHARED_API_NAME : Vec<CString> = Vec::new(); |
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.
We can make it a static slice:
static VEC_EXPORT_SHARED_API_NAME: &'static str = &["RedisJSON_V1", ...];
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.
Also why does it need to be static lifetime?
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.
https://github.com/redis/redis/blob/unstable/src/module.c#L10498-L10500
IMPORTANT: the apiname argument should be a string literal with static
lifetime. The API relies on the fact that it will always be valid in
the future.
int RM_ExportSharedAPI(RedisModuleCtx *ctx, const char *apiname, void *func) {
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.
Few more comments.
This PR adds LLAPI functionality for opening a RedisJSON key with flags
this is mainly to be used in the RediSearch
getKeyCommonJSON
whereNO_EFFECTS
flag should be send, to abvoid key expiration (write path) while quering (read path).