Skip to content
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

Bolt protocol #6

Merged
merged 61 commits into from
Sep 11, 2023
Merged

Bolt protocol #6

merged 61 commits into from
Sep 11, 2023

Conversation

AviAvni
Copy link
Contributor

@AviAvni AviAvni commented Jul 31, 2023

No description provided.

@AviAvni AviAvni requested a review from swilly22 July 31, 2023 14:42
Copy link
Contributor

@swilly22 swilly22 left a comment

Choose a reason for hiding this comment

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

Overall an interesting PR, I think there's some code relocation to be made but overall pretty straightforward and nicely integrated.

Comment on lines 146 to 158
bolt_reply_structure(bolt_client, BST_SUCCESS, 1);
bolt_reply_map(bolt_client, 3);
bolt_reply_string(bolt_client, "t_first");
bolt_reply_int8(bolt_client, 2);
bolt_reply_string(bolt_client, "fields");
bolt_reply_list(bolt_client, array_len(columns));
for(int i = 0; i < array_len(columns); i++) {
bolt_reply_string(bolt_client, columns[i]);
}
bolt_reply_string(bolt_client, "qid");
bolt_reply_int8(bolt_client, 0);
bolt_client_send(bolt_client);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a comment describing the reply structure here, things such as: t_first and qid aren't clear.

src/resultset/formatters/resultset_replybolt.c Outdated Show resolved Hide resolved
src/resultset/formatters/resultset_replybolt.c Outdated Show resolved Hide resolved
Comment on lines 43 to 67
Node *n = v.ptrval;
bolt_reply_structure(client, BST_NODE, 4);
bolt_reply_int64(client, n->id);
uint lbls_count;
NODE_GET_LABELS(gc->g, n, lbls_count);
bolt_reply_list(client, lbls_count);
for(int i = 0; i < lbls_count; i++) {
Schema *s = GraphContext_GetSchemaByID(gc, labels[i], SCHEMA_NODE);
const char *lbl_name = Schema_GetName(s);
bolt_reply_string(client, lbl_name);
}
const AttributeSet set = GraphEntity_GetAttributes((GraphEntity *)n);
int prop_count = ATTRIBUTE_SET_COUNT(set);
bolt_reply_map(client, prop_count);
// Iterate over all properties stored on entity
for(int i = 0; i < prop_count; i ++) {
Attribute_ID attr_id;
SIValue value = AttributeSet_GetIdx(set, i, &attr_id);
// Emit the actual string
const char *prop_str = GraphContext_GetAttributeString(gc, attr_id);
bolt_reply_string(client, prop_str);
// Emit the value
_ResultSet_BoltReplyWithSIValue(client, gc, value);
}
bolt_reply_string(client, "node_0");
Copy link
Contributor

Choose a reason for hiding this comment

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

can you please explain node_0 ?

Comment on lines 92 to 94
bolt_reply_string(client, "relationship_0");
bolt_reply_string(client, "node_0");
bolt_reply_string(client, "node_0");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you please explain these strings: node_0 and relationship_0 ?

src/module.c Outdated
Comment on lines 335 to 340
char data[4];
data[0] = 0x00;
data[1] = 0x00;
data[2] = version.minor;
data[3] = version.major;
socket_write(client, data, 4);
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider moving into a dedicated bolt response / command API

src/module.c Outdated Show resolved Hide resolved
src/module.c Outdated Show resolved Hide resolved
src/module.c Outdated
return;
}

client->read_index = 0;
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we setting read_index to 0 ? what are we doing with the data we just read ?

src/module.c Outdated Show resolved Hide resolved

size_t indices = node_count + edge_count - 1;
bolt_reply_list(client, indices);
for(uint8_t i = 0; i < edge_count; i++) {

Check failure

Code scanning / CodeQL

Comparison of narrow type with wide type in loop condition High

Comparison between
i
of type uint8_t and
edge_count
of wider type size_t.
@swilly22 swilly22 changed the base branch from master to 4.0.0-alpha.1 September 11, 2023 05:22
@swilly22 swilly22 merged commit 229030f into 4.0.0-alpha.1 Sep 11, 2023
1 of 2 checks passed
@swilly22 swilly22 deleted the bolt-protocol branch September 11, 2023 05:25
@swilly22 swilly22 restored the bolt-protocol branch September 11, 2023 07:11

Choose a reason for hiding this comment

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

Do you run these feature-tests both for Bolt and Redis protocols?

AviAvni added a commit that referenced this pull request Oct 29, 2023
* create vector index structure only

* create a float32 vector

* bump encoder version

* unified encoding decoding versions

* support additional sivalue functionality

* add support for vector64

* vector byte size

* query vector index

* use vector byte size when constructing index query

* update redisearch submodule

* remove support for vector64

* index util for creating and query vector index

* remove parser submodule

* merge fulltext and exactmatch indices

* leaks

* wip integrate new syntax

* enable test

* separate index creation to individual types

* index creation is an undoable operation

* index level configuration

* index creation must create any effects

* db.indexes specifies each field types

* implement new drop index syntax

* refine drop index

* test index drop

* test index creation

* migrate to new index functions

* debug flow tests

* free fields

* switch to index utils

* wrong formatting

* debugging

* update redisearch to latest commit

* fix leak

* wip

* multi type index scan

* disable failing test

* Bolt protocol (#6)

* wip bolt protocol

* remove log

* remove malloc

* clean

* handle client state

* fixes

* handle client response

* fix bug

* handle chunks

* fix remove node label

* fix reserve node for merge

* socket read exact size

* increase buffer size

* clean

* fix

* fix merge

* address review

* fix delete issue

* add tests

* address review

* fix path

* add tiny int support

* address reivew

* review

* parse parameters

* fixes

* add bolt api

* fix leaks

* add bolt tck

* clean

* rename

* fix bolt assertions

* fix bolt assertions

* fix path direction

* wip pipeline

* wip pipeline

* fix endian

* better shutdown

* wip pipeline

* fixes

* fix tck check

* bolt reply stats

* tests

* fix

* doc

* doc

* add connection_id

* fix crash when client closed

* use detached redismodulectx

* wait for pull

* perf

* perf

* Revert "perf"

This reverts commit a6eeacc.

---------

Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>

* perf

* fix sanitizer build

* bolt port according to redis port

* only index entity if updated attribute is part of the index

* reduce test memory consumption

* update sanitizer build docker image

* removed extra encoder

* improve bolt perf

* fix reset

* remove redundant encoder

* review

* add buffer

* address review comments

* Update build.yml - latest tag

* Update build.yml

* Update build.yml

* add docker tls support

* tls auth clients

* fix tests

---------

Co-authored-by: AviAvni <avi.avni@gmail.com>
Co-authored-by: Guy Korland <gkorland@gmail.com>
AviAvni added a commit that referenced this pull request Oct 29, 2023
* create vector index structure only

* create a float32 vector

* bump encoder version

* unified encoding decoding versions

* support additional sivalue functionality

* add support for vector64

* vector byte size

* query vector index

* use vector byte size when constructing index query

* update redisearch submodule

* remove support for vector64

* index util for creating and query vector index

* remove parser submodule

* merge fulltext and exactmatch indices

* leaks

* wip integrate new syntax

* enable test

* separate index creation to individual types

* index creation is an undoable operation

* index level configuration

* index creation must create any effects

* db.indexes specifies each field types

* implement new drop index syntax

* refine drop index

* test index drop

* test index creation

* migrate to new index functions

* debug flow tests

* free fields

* switch to index utils

* wrong formatting

* debugging

* update redisearch to latest commit

* fix leak

* wip

* multi type index scan

* disable failing test

* Bolt protocol (#6)

* wip bolt protocol

* remove log

* remove malloc

* clean

* handle client state

* fixes

* handle client response

* fix bug

* handle chunks

* fix remove node label

* fix reserve node for merge

* socket read exact size

* increase buffer size

* clean

* fix

* fix merge

* address review

* fix delete issue

* add tests

* address review

* fix path

* add tiny int support

* address reivew

* review

* parse parameters

* fixes

* add bolt api

* fix leaks

* add bolt tck

* clean

* rename

* fix bolt assertions

* fix bolt assertions

* fix path direction

* wip pipeline

* wip pipeline

* fix endian

* better shutdown

* wip pipeline

* fixes

* fix tck check

* bolt reply stats

* tests

* fix

* doc

* doc

* add connection_id

* fix crash when client closed

* use detached redismodulectx

* wait for pull

* perf

* perf

* Revert "perf"

This reverts commit a6eeacc.

---------

Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>

* perf

* fix sanitizer build

* bolt port according to redis port

* only index entity if updated attribute is part of the index

* reduce test memory consumption

* update sanitizer build docker image

* removed extra encoder

* improve bolt perf

* fix reset

* remove redundant encoder

* review

* add buffer

* address review comments

* Update build.yml - latest tag

* Update build.yml

* Update build.yml

* wip websocket

* fixes

* set non blocking

* fix handshake fo non blocking client

* fix large message write

* better write

* fix client shutdown and write perf

* document buffer

* add docker tls support

* tls auth clients

* fix quantifier null handling

---------

Co-authored-by: swilly22 <roi@redislabs.com>
Co-authored-by: Roi Lipman <swilly22@users.noreply.github.com>
Co-authored-by: Guy Korland <gkorland@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants