appy-one / acebase

A fast, low memory, transactional, index & query enabled NoSQL database engine and server for node.js and browser with realtime data change notifications
MIT License
481 stars 27 forks source link

Error: DEV: Applied tree fixes did not change 88 pending operation(s) failing to execute #242

Closed darkjedi9922 closed 1 year ago

darkjedi9922 commented 1 year ago

Hello again, thank you for the previous fix (issue #239). Now I am getting a new error with following steps:

  1. Add a "large" dataset (e.g. 110 records)
  2. Remove these records with a query
  3. Add the same dataset again. This fails with error:
Error: DEV: Applied tree fixes did not change 88 pending operation(s) failing to execute. Debug this, check fixHistory!
    at processOperations (S:\Projects\debug\acebase\dist\cjs\storage\binary\index.js:3328:23)
    at processOperations (S:\Projects\debug\acebase\dist\cjs\storage\binary\index.js:3396:24)
    at async _mergeNode (S:\Projects\debug\acebase\dist\cjs\storage\binary\index.js:3399:25)
    at async Object.write [as _customWriteFunction] (S:\Projects\debug\acebase\dist\cjs\storage\binary\index.js:1945:28)
    at async AceBaseStorage._updateNode (S:\Projects\debug\acebase\dist\cjs\storage\binary\index.js:1957:26)
    at async AceBaseStorage.updateNode (S:\Projects\debug\acebase\dist\cjs\storage\binary\index.js:1891:27)
    at async LocalApi.update (S:\Projects\debug\acebase\dist\cjs\api-local.js:70:24)
    at async DataReference.update (S:\Projects\debug\acebase\node_modules\acebase-core\dist\cjs\data-reference.js:232:36)
    at async S:\Projects\debug\acebase\spec\custom-test.js:25:5

Node.js v18.15.0

There are also another messages before the final error, like:

[custom-test] Could not update tree for "/table": Cannot read properties of undefined (reading 'entries'), undefined
[custom-test] Could not update tree for "/table" (retry 1): Cannot read properties of undefined (reading 'entries'), undefined
[custom-test] Could not update tree for "/table" (retry 22): Failed to rebuild leaf: Tx failed, rolled back. See .info for details, rebuild-leaf-failed,tx-failed

The test where the problem is reproduced: https://github.com/darkjedi9922/acebase-bug-reproduce/blob/bug-reproduce-2/spec/custom-test.js

appy-one commented 1 year ago

I applied a fix for this in 1.29.4, thanks again for supplying a good PR with example code!

Do you like AceBase? šŸ‘‡šŸ¼

Sponsor AceBase Spread the word contribute