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

feat(cairo): wait for writer if it's about to be released by maintanance from the pool #1695

Merged
merged 32 commits into from
Dec 16, 2021

Conversation

ideoma
Copy link
Collaborator

@ideoma ideoma commented Dec 15, 2021

Few issues with Engine maintanance and Writer pool fixed:

  • When CairoEngine examines WriterPool periodically to evict and close old unused entries it blocks writer for a period of time needed to close the instance. If an Insert statement is processed at the same time it will get writer busy error with empty reason. To prevent it WriterPool will lock the entries about to be evicted with negative thread id and if such a lock found in get method another attempt to re-acquire the writer will be performed.
  • When Writer Pool is examined by CairoEngine it will unconditionally unlock all locked table entries. If a table is being created at the time where maintanance the creation fails
    Make busy writer Alter table test more stable in PgWire and Http Json integration tests.

ideoma and others added 26 commits December 11, 2021 23:58
…g_tests_fixes

 Conflicts:
	core/src/main/java/io/questdb/cairo/pool/WriterPool.java
	core/src/test/java/io/questdb/cairo/pool/WriterPoolTest.java
- make DispatcherWriterQueueTest more stable
@ideoma
Copy link
Collaborator Author

ideoma commented Dec 16, 2021

[PR Coverage check]

😍 pass : 70 / 80 (87.50%)

file detail

path covered line new line coverage
🔵 io/questdb/cairo/pool/WriterPool.java 39 49 79.59%
🔵 io/questdb/cutlass/pgwire/PGWireServer.java 5 5 100.00%
🔵 io/questdb/cairo/TableWriter.java 1 1 100.00%
🔵 io/questdb/griffin/QueryFutureUpdateListener.java 1 1 100.00%
🔵 io/questdb/griffin/SqlExecutionContextImpl.java 1 1 100.00%
🔵 io/questdb/cutlass/pgwire/PGConnectionContext.java 2 2 100.00%
🔵 io/questdb/log/LogAlertSocket.java 13 13 100.00%
🔵 io/questdb/griffin/SqlCompiler.java 1 1 100.00%
🔵 io/questdb/cutlass/http/processors/JsonQueryProcessor.java 3 3 100.00%
🔵 io/questdb/griffin/CompiledQueryImpl.java 4 4 100.00%

@bluestreak01 bluestreak01 merged commit 656d084 into master Dec 16, 2021
@bluestreak01 bluestreak01 deleted the fix-alter-table-tests2 branch December 16, 2021 07:07
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

2 participants