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

Turning everything to async #17

Closed
AlexanderMihail opened this issue Apr 14, 2024 · 1 comment
Closed

Turning everything to async #17

AlexanderMihail opened this issue Apr 14, 2024 · 1 comment
Assignees

Comments

@AlexanderMihail
Copy link
Owner

AlexanderMihail commented Apr 14, 2024

Turned the long-running operation of self_test to coroutine.
Another long-runner is the index compactor. It should also be turned to async.
Table get/set/list, etc should probably also go the async way, for good measure.

The seastar SIG35 occurs repeatedly generally during sstring operations (probably requiring reallocation).
Got to chase those.

It seems to be relating to executor bloked on a long operation (the database self-tests).

Release console message:

Reactor stalled for 69 ms on shard 0. Backtrace: 0x1604ae 0x11eba0 0x11f106 0x11f2df 0x4251f 0x8df74 0x7700b 0x81988 0x60927 0xa17d1 0xa24af 0xa1c5f 0xa41ef 0x1e596e 0x1c18c0 0x1c20a7 0x1c26d6 0x1c4d8d 0x1c5f30 0x11ad57 0x11b082 0x150375 0x150e6c 0xb09d0 0xb13cf 0x7148c 0x29d8f 0x29e3f 0x73944

@AlexanderMihail AlexanderMihail added the bug Something isn't working label Apr 14, 2024
@AlexanderMihail AlexanderMihail self-assigned this Apr 14, 2024
@AlexanderMihail AlexanderMihail removed the bug Something isn't working label Apr 15, 2024
@AlexanderMihail AlexanderMihail changed the title SIG35 Another branch with everything turned to async Apr 15, 2024
AlexanderMihail pushed a commit that referenced this issue Apr 16, 2024
… to the main page before that. This is to avoid quit-restarting in a loop. Perparing to async-ify. A global and configurable mode_async. Added a rest provision to read the console log, if available. Reporting the sub-log of a Failed test when running in a loop. Git-ignoring Visual Studio temporary files and user-files of cmake. Working on issue #17.
AlexanderMihail pushed a commit that referenced this issue Apr 16, 2024
… to the main page before that. This is to avoid quit-restarting in a loop. Perparing to async-ify. A global and configurable mode_async. Added a rest provision to read the console log, if available. Reporting the sub-log of a Failed test when running in a loop. Git-ignoring Visual Studio temporary files and user-files of cmake. Working on issue #17.
AlexanderMihail pushed a commit that referenced this issue Apr 16, 2024
… to the main page before that. This is to avoid quit-restarting in a loop. Perparing to async-ify. A global and configurable mode_async. Added a rest provision to read the console log, if available. Reporting the sub-log of a Failed test when running in a loop. Git-ignoring Visual Studio temporary files and user-files of cmake. Working on issue #17.
AlexanderMihail pushed a commit that referenced this issue Apr 16, 2024
…e back to the main page before that. This is to avoid quit-restarting in a loop. Perparing to async-ify. A global and configurable mode_async.

Added the static Table::co_self_test coroutine to wrap around run Table::self_test. The HTTP DefaultHandler calls either the self_test or the co_self_test depending on mode_async. In async mode, the self-test, which is a huge time penalty, is coroutined in the hope that it would split-up into individual, smaller, batches for the SHARD executor. This is to increase parallelism of the HTTP server when multiple users are concurrently active. Table::self_test is recursive in loop mode, and potentially endless. Merged the Prometheus sats server into the Database Demo server so only one port is exposed from the demo container. Added a rest provision to read the console log, if available. Reporting the sub-log of a Failed test when running in a loop. Git-ignoring Visual Studio temporary files and user-files of cmake. Working on issue #17.
@AlexanderMihail
Copy link
Owner Author

Table::self_test(int test, int loop, string &s) is a long-running task, which, depending on the loop count, may be infinite. The self_test is one-level recursive. It is sure to hog the SHARD that undertook the HTTP request. This was the prime candidate for async-ifying. In the latest version, depending on Table::mode_async toggle, the path of the self_test is going through a wrapper coroutine:

seastar_db/demos/db_demo.cc

Lines 821 to 824 in 3b80cd1

static seastar::future<bool> co_self_test(int test, int loop, std::string &s)
{
co_return self_test(test, loop, s);
}

seastar_db/demos/db_demo.cc

Lines 1142 to 1151 in 3b80cd1

auto test = req->query_parameters.at("self_test");
int tn;
sscanf(test.c_str(),"%d", &tn);
auto loop = req->query_parameters.contains("loop") ? req->query_parameters.at("loop") : "1";
int l;
sscanf(loop.c_str(),"%d", &l);
std::string text;
bool result = Table::mode_async ?
co_await Table::co_self_test(tn, l, text) :
Table::self_test(tn, l, text);

@AlexanderMihail AlexanderMihail changed the title Another branch with everything turned to async Turning everything to async Apr 18, 2024
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

No branches or pull requests

1 participant