Hi! I’m facing the following issue. It seems it is related to live queries and index updates.
I did some testing, my setup was working well when indexing by keys that are not included as parameters in live queries.
As I indexed my data by key/keys included in a live query my node script started
This is my system setup:
acebase-server@1.16.2
acebase-client@1.20.1
acebase@1.28.3
This is what works well:
I have data objects stored in ‘items’ folder, each one has unique ID.
Item/uniqueid/{category: category1, location: location1, status: 1}
Item/uniqueid/{category: category2, location: location1, status: 3}
Item/uniqueid/{..}
Etc.
Then I have two indexes set up:
Index(‘item’, ‘category’);
Index(‘item’, ‘location);
Also, I have a running a live query listening to changes on ‘status’ property (on my app client).
I’m adding new items, then updating them (status is updated) and later some items are removed. Data removal is done periodically (every 10min). All updates are done sequentially.
This is what not working well:
I have the same setup as above:
The difference is: now I have added an index:
Index(‘item’, ‘status);
I still have a running live query listening to changes on ‘status’ property as before (on my app client).
This works well until the data removal script has started to remove items.
Now I see the following error and node script restarts:
/loc1/xxx/xxxx/nodejs/node_modules/acebase-client/dist/cjs/request/index.js:89
reject(new error_1.AceBaseRequestError(request, null, err.code || err.name, err.message));
^
AceBaseRequestError: connect ECONNRESET XXXXXXXXXXXXXXXXXXX:1234
at ClientRequest. (/loc1/xxx/xxxx/nodejs/node_modules/acebase-client/dist/cjs/request/index.js:89:20)
at ClientRequest.emit (node:events:390:28)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
request: {
method: 'PUT',
protocol: 'https:',
host: 'xxxxxxxxx',
port: '1234',
path: '/data/acebase_test/items/1197171',
headers: {
'AceBase-Context': '{"skipProcess":true,"acebase_mutation":{"client_id":"xxxxxxxxx","id":"xxxxxxxxxxxxx","op":"set","path":"items/1197171","flow":"server"}}',
'Content-Type': 'application/json',
'Content-Length': 12,
Authorization: 'Bearer xxxxxxxxxx=='
},
body: undefined
},
response: null,
code: 'ECONNRESET'
}
I don’t see any errors when my data removal script is disabled.
It seems deletion process interferes with the index. The index (on status key) gets corrupted and I have to recreate it. I have tried deleting data items using delete query as well.
Hi! I’m facing the following issue. It seems it is related to live queries and index updates.
I did some testing, my setup was working well when indexing by keys that are not included as parameters in live queries.
As I indexed my data by key/keys included in a live query my node script started
This is my system setup:
acebase-server@1.16.2
acebase-client@1.20.1
acebase@1.28.3
This is what works well:
I have data objects stored in ‘items’ folder, each one has unique ID.
Item/uniqueid/{category: category1, location: location1, status: 1}
Item/uniqueid/{category: category2, location: location1, status: 3}
Item/uniqueid/{..}
Etc.
Then I have two indexes set up:
Index(‘item’, ‘category’);
Index(‘item’, ‘location);
Also, I have a running a live query listening to changes on ‘status’ property (on my app client).
I’m adding new items, then updating them (status is updated) and later some items are removed. Data removal is done periodically (every 10min). All updates are done sequentially.
This is what not working well:
I have the same setup as above:
The difference is: now I have added an index:
Index(‘item’, ‘status);
I still have a running live query listening to changes on ‘status’ property as before (on my app client).
This works well until the data removal script has started to remove items.
Now I see the following error and node script restarts:
/loc1/xxx/xxxx/nodejs/node_modules/acebase-client/dist/cjs/request/index.js:89
reject(new error_1.AceBaseRequestError(request, null, err.code || err.name, err.message));
^
AceBaseRequestError: connect ECONNRESET XXXXXXXXXXXXXXXXXXX:1234
at ClientRequest. (/loc1/xxx/xxxx/nodejs/node_modules/acebase-client/dist/cjs/request/index.js:89:20)
at ClientRequest.emit (node:events:390:28)
at TLSSocket.socketErrorListener (node:_http_client:447:9)
at TLSSocket.emit (node:events:390:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
request: {
method: 'PUT',
protocol: 'https:',
host: 'xxxxxxxxx',
port: '1234',
path: '/data/acebase_test/items/1197171',
headers: {
'AceBase-Context': '{"skipProcess":true,"acebase_mutation":{"client_id":"xxxxxxxxx","id":"xxxxxxxxxxxxx","op":"set","path":"items/1197171","flow":"server"}}',
'Content-Type': 'application/json',
'Content-Length': 12,
Authorization: 'Bearer xxxxxxxxxx=='
},
body: undefined
},
response: null,
code: 'ECONNRESET'
}
I don’t see any errors when my data removal script is disabled.
It seems deletion process interferes with the index. The index (on status key) gets corrupted and I have to recreate it. I have tried deleting data items using delete query as well.