-
Notifications
You must be signed in to change notification settings - Fork 3
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
Updating js-db to 5.x.x (integrating RocksDB and DB-native concurrency control) #67
Conversation
The problem with updating js-logger here (which we need to do in order to update it in PK) is that it also means we need to update the DB, but this also means incorporating all of the new (breaking) changes from 5.0.0 of |
Hold on this PR, the js-db update is more pressing first. And we don't need to update the EFS yet. The js-db 5.0.0 is first being updated in PK. EFS can stay on the original js-db. |
What you can do is to merge in the non-js-db and non-js-logger changes in first. There's just a bunch of CI/CD stuff. Can you split up the commit into a separate PR for just the staging and ci/cd and other chores. |
Ok. EFS won't work inside PK if it's running the old DB though, since the old DB uses the old logger, which conflicts with the new logger used by the new DB in PK, so it will need to be updated here eventually. |
Actually you can do it. You just won't be able to pass a "child" logger into the DB that EFS is using. So you can just remove that parameter entirely. |
Now that I've updated the logger for all of the other libraries though we can no longer pass a logger through to any of the other libraries from EFS. I think this is only an issue for |
c3b0381
to
4789d8e
Compare
ee0b9e2 now contains all of the CI/CD changes but doesn't update the logger or DB. As such, it doesn't pass a logger through to any of the workers since |
4789d8e
to
db877c9
Compare
@emmacasolin please update to using 1.3.6 of js-workers. It is now compatible with swc. The quickfix is to swap from using This needs to be fixed in
To make it usable. Then |
The same fix has to be applied to PK as well under |
Creation of temporary directory with |
@emmacasolin this PR needs to be split up. The js-db changes should be moved into a new PR. This PR should only focus on synchronising changes, updating the js-logger, and the fix that @tegefaulkes just added. |
I suspect that the test failures are coming from the js-db changes. The js-db update should be postponed till later. @tegefaulkes |
Actually I was confused, the recent fix should go to #68 and #67. Will rename this PR to suit. @tegefaulkes can you reset the commit you just pushed? |
When this is being worked on all:
Should be removed from the source, tests and benchmarks as Unlike in Polykey where it has a commit that we can revert, this PR won't have that convenience. |
0084570
to
db877c9
Compare
Removed the fix commit from here and pushed it to staging. |
Fast-check can be used to combine a number of concurrency tests together. For example, concurrent file writes using a number of methods can be the same test. for these tests the the result matters less than avoiding transaction conflicts. we still want to check that something has been written however. |
The
|
8b779f3
to
90454cb
Compare
This should be good to merge now. Pending review if desired. |
Can you rerun the benchmarks and show the comparison here. Since the db has changed, I'm expecting it should be alot faster. |
Oh yea you need to provide the type of the lock. So don't worry.
|
90454cb
to
b20a89f
Compare
Ok so for all the concurrent tests where you have replaced the test, change to using a regular expression to match the original predicates on the output. I've given some examples above. For the new tests, this can also be done if you see an easy way to write the regular expression. Prefer this over simply checks like Then proceed to merge to On the staging branch, regenerate docs and redo the benchmarks. |
There's a documented way of doing delaying the actual async functions for the fast check scheduler: dubzzz/fast-check#564. See the relevant commits. I also asked a question upstream to see how it should be done. The docs also got moved around recently and the relevant commits point to: https://github.com/dubzzz/fast-check/blob/main/packages/fast-check/documentation/RaceConditions.md There's no inbuilt helper for this. The docs suggest: const scheduleCall = <T>(s: Scheduler, f: () => Promise<T>) => {
s.schedule(Promise.resolve("USE THIS AS A LABEL...")).then(() => f());
}
// Calling doStuff will be part of the task scheduled in s
scheduleCall(s, () => doStuff()) It's very similar to what you already did with the Using the above method you also don't need a separate factory. The last interesting thing is |
RIght, just need to squash and checks. Then this will be ready to merge. |
Did you check the rest of the tests you replaced to ensure that no predicates are missing? I didn't go through all of them. |
- `@matrixai/db` 5.0.2 supports `ToString` lock requests
This was needed for the very specific case where `_open` was used to create a file during an existing transaction.
fix: `tests/inodes/INodeManager.test.ts` change to using `await expect().rejects.toThrow`
This just adds some tests that hit the API with a bunch of concurrent operations with random order. This is to check for any db transaction errors.
Yes, I went through all of the ones I updated. |
b6d426a
to
55b2718
Compare
Cleaned up the commit history. |
Just waiting on CI now. |
I've asked about the integrating timeouts between fast check and jest: dubzzz/fast-check#3084 |
…`tests/utils.ts`
Description
Updating CI/CD including:
Related:
Tasks
js-logger
@matrixai/db
to 5.0.1,Final checklist