1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-09-13 21:21:50 +03:00
Commit Graph

48 Commits

Author SHA1 Message Date
mariadb-AlanMologorsky
8bfb2ce2e1 temp fix deactivate_only. 2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
6b9637d748 Another fixes for tests. 2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
6a656b65d2 Fixes and improvements after tests.
- fixed enpoints.py put_config
- improved request_models to support set_cluster_mode command
- improved logging for shared file check
- fix race condition while writing and reading shared temp file
- changed delay between checking shared storage to 10 sec
- fix tests
2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
b8cc7d2c7b Added Pydantic Models for Config put endpoint.
Changed config put request body validation to use Pydantic models.
2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
fc95dbbdbd Fix another broken rebase + more logging. 2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
4f738fbde2 Fix broken after rebase requirements.txt. 2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
33c0b2c3fb Review fixes.
- Implemented Pydantic models and validation.
- Added separated endpoint for broadcasting stateful config (next releases)
- Fixed some not threadsafe AppStatefulConfig methods.
2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
0b9b63c30b - add AppStatefulConfig, StateConfigVersion classes to implement CMAPI in memory stateful configuration
- add stateful config distribution logic into endpoints.ConfigController (node endpoint) with fast "only_stateful_config" update logic
- add stateful config logic into helpers.broadcast_new_config
- add new function broadcast_stateful_config into helpers.py
- port Alexander Presnyakov get_existing_db_roots function into node_manipulation.py from other branch
- add new SharedStorageMonitor threaded compomemt for Failover it starts working with NodeMonitor component as a separate thread that checks shared storage state/health each 5 mins.
2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
94d28d250b addition 2025-09-12 15:45:07 +03:00
mariadb-AlanMologorsky
3aa3b884e7 feat(cmapi): MCOL-6006 Disable failover when shared storage not detected
add Base api client
add NodeController api client
fix ClusterController Api client
add NodeController in endpoints.py
add 2 new endpoints to dispatcher: cluster/check-shared-storage and node/check-shared-file
add check_shared_storage method into ClusterHandler class
add set_shared_storage to node_manipulation t
add reading shared_storage in failover/config.py
fix is_shared_storage method in failover/config.py
add check_shared_storage in NodeMonitor class
fix some minor styling
2025-09-12 15:45:07 +03:00
Alexander Presnyakov
ade880fe78 Return original default value of deactivate_only (False) 2025-09-11 19:49:31 +04:00
Alexander Presnyakov
151903cd18 Tracing fixes:
Don't log trace_params in tracing logger, because it already has all this data
Don't print span attrs, it can contain lots of headers
Save small part of the response into the span, if the response was a JSON string
Added JSON logging of trace details into a separate file (to not spam the main log with machine readable stuff)
Record part of the response into the span
Set duration attribute in server spans
Log 404 errors
Colorize the traces (each span slightly changes the color of the parent span)
Improve trace visualization with duration formatting and notes for request/response pairs
2025-09-10 17:06:12 +00:00
mariadb-AlanMologorsky
194e7ccbdc fix(timeout): MCOL-5508 make node unresponse timeout configurable
Read DBRM unresponsive timeout from Columnstore.xml DBRMUnresponsiveTimeout Tag instead of hardcoded 300 sec value.
2025-09-10 19:19:40 +04:00
Alexander Presnyakov
55241e6f0e Fixed import problem 2025-09-09 17:23:20 +04:00
Alexander Presnyakov
bd1575d34a Handle waiting locks 2025-09-09 17:23:20 +04:00
Alexander Presnyakov
cff5244e35 Use the same mcs-shmem-locks tool that we used to inspect locks state to unlock them 2025-09-09 17:23:20 +04:00
Alexander Presnyakov
384dd56a61 Moved locks cleanup into cmapi 2025-09-09 17:23:20 +04:00
Alexander Presnyakov
48e14ed5e5 MCOL-6094: reset shmem locks before stopping workernode 2025-09-09 17:23:20 +04:00
Alexander Presnyakov
113d6cc41b Disabled sentry backend debug prints
Added couple of debug prints for host readiness
2025-09-03 20:32:03 +04:00
Alexander Presnyakov
08d46a9e70 Pass git revision from the build process -> cmapi - Sentry (to be able to understand which revision caused some error) 2025-09-03 20:32:03 +04:00
Alexander Presnyakov
9821f14d0f Enable loggers that were not explicitly mentioned in cmapi_logger.conf 2025-09-03 20:32:03 +04:00
Alexander Presnyakov
9b98c5c20a Created a separate package for tracing-related stuff
Added mirroring of spans into Sentry
Tracer is a facade that redirects actions to tracing backends
2025-09-03 20:32:03 +04:00
Alexander Presnyakov
a0b4bcd1ce Basic request tracer
Tracing requests

Custom log factory adds all trace values as one log record parameter (it will be empty if trace values are empty, like in MainThread where there are no incoming requests)
2025-09-03 20:32:03 +04:00
Alexander Presnyakov
5939aa5f55 Added support for Sentry in cmapi server
Support distributed request tracing

-Direct dependencies now in requirements[-dev].in, pip-compile generates full requirement[-dev].txt from them
2025-08-26 14:21:33 +00:00
Alexander Presnyakov
19c4914194 feat/MCOL-6074: CMAPI integrational tests that work with real hosts (using columnstore-ansible-aws for cluster creation/provisioning) 2025-08-12 13:08:31 +00:00
Alexander Presnyakov
58040871bd Fixed "raise None" that happened on signal interception
Also fixed couple of (possibly) unbound variables
2025-08-11 16:48:19 +00:00
Alexander Presnyakov
f8a57b4412 BRM journal is always singular, do not apply suffix logic to it 2025-07-25 14:54:59 +01:00
mariadb-AlanMologorsky
b6a5c1d71f fix(cmapi): MCOL-5913 cmapi write local address 127.0.1.1 instead real ip address
* feat(cmapi): NetworkManager class for some ip hostname opoerations.
 * fix(cmapi): Use NetworkManager class to resolve ip and hostname in node_manipulation.add_node function
 * fix(cmapi): Minor docstring and formatting fixes
2025-07-08 15:57:28 +03:00
mariadb-AlanMologorsky
5d0b3a88f3 fix(cmapi): MCOL-5899 confusing cluster_mode status when columnstore offline. 2025-06-19 19:22:44 +04:00
aleksei.bukhalov
3de8af2fa4 chore(ci): remove sudo usage from systemctl calls in cmapi tests 2025-06-03 22:30:22 +02:00
Alexander Presnyakov
e34f7d2530 Fix thread arg errors (app instead of sequence) 2025-04-18 18:52:42 +01:00
mariadb-AlanMologorsky
d17fc7d9be Review fixes. 2025-04-08 14:56:06 +03:00
mariadb-AlanMologorsky
aa57a7684c feat(cmapi): MCOL-5019: review fixes.
[fix] CEJPasswordHandler class methods to use directory for cskeys file
[fix] CEJPasswordHandler.encrypt_password to return password in hex format
[fix] CEJPasswordHandler key_length
[fix] CEJPasswordHandler os.urandom call typo
[upd] mcs cli README.md and man page
[upd] mcs cli README_DEV.md
[fix] mcs_cluster_tool/decorators.py to handle typer.Exit exception
[add] various docstrings
2025-04-08 14:56:06 +03:00
mariadb-AlanMologorsky
215e4eea4d feat(cmapi): MCOL-5019: distributing cskeys secrets file, move cskeys and cspasswd functions to mcs cli.
[add] distribute .secrets file to all nodes while adding a new node
[add] encrypt_password, generate_secrets_data, save_secrets to CEJPasswordHandler
[add] tools section to mcs cli tool
[add] mcs_cluster_tool/tools_commands.py file with cskeys and cspasswd commands
[add] cskeys and cspasswd commands to tools section of mcs cli
[mv] backup/restore commands to tools section mcs cli
[fix] minor imports ordering
[fix] constants
2025-04-08 14:56:06 +03:00
mariadb-AlanMologorsky
10dec6ea94 fix(cmapi): MCOL-5962 Fix rollback in mcs cli and passing errors during broadcasting config
* fix(cmapi): ClusterControllerClient request error handling
* fix(cmapi): broadcast_new_config request error handling
* style(cmapi): logs
2025-04-07 14:34:13 +03:00
mariadb-AlanMologorsky
55b09a71fc fix(cmapi): MCOL-5638 Improve Client Error Messaging and async broadcasting config.
* fix(cmapi): broadcast_new_config function using aiohttp and improved errors handling mechanics
* fix(cmapi): requirements updating aiohttp version and it's dependencies
* fix(cmapi, deps): unused imports
* fix(cmapi, tests): test_broadcast_new_config
2025-04-01 17:27:22 +03:00
mariadb-AlanMologorsky
2f25c47a57 fix(cmapi): MCOL-5133 remove has_active_nodes handler for cluster shutdown because TransactionManager has advance variant of this check 2025-04-01 18:03:07 +04:00
mariadb-AlanMologorsky
0e5842abcc fix(cmapi tests): MCOL-5133 test mode set without nodes now returns adequate message 2025-04-01 18:03:07 +04:00
mariadb-AlanMologorsky
8a4f857df4 fix(cmapi): MCOL-5133 maintainance flag typo. 2025-04-01 18:03:07 +04:00
mariadb-AlanMologorsky
27e3b8d808 feat(cmapi): MCOL-5133: Stage3 stand alone cli tool.
MAJOR: Some logic inside node remove changed significantly using active
    nodes list from Columnstore.xml to broadcast config after remove.

 [fix] TransactionManager passsing  extra, remove and optional nodes arguments to start_transaction function
 [fix] commit and rollback methods of TransactionManager adding nodes argument
 [fix] TransactionManager using success_txn_nodes inside
 [fix] remove node logic to use Transaction manager
 [fix] cluster set api key call using totp on a top level cli call
 [add] missed docstrings
 [fix] cluster shutdown timeout for next release
2025-04-01 18:03:07 +04:00
mariadb-AlanMologorsky
c40e4ba00d feat(cmapi): MCOL-5133: Stage2 stand alone cli tool.
[fix] client class methods
[fix] Transaction management at endpoint handling level
[fix] add_node and set_mode methods to use TransactionManager
2025-04-01 18:03:07 +04:00
Alan Mologorsky
a60a5288d8 feat(cmapi): MCOL-5133: Stage1 to stand alone cli tool. (#3378)
[add] cluster api client class
[fix] cli cluster_app using cluster api client
[add] ClusterAction Enum
[add] toggle_cluster_state function to reduce code duplication
2025-04-01 18:03:07 +04:00
Alan Mologorsky
a00711cc16 fix!(cmapi): MCOL-5454: Self-signed certificate autorenew. (#3213)
[add] managers/certificate.py with CertificateManger class
[mv] creating self-signed certificate logic into CertificateManger class
[add] renew and days_before_expire methods to CertificateManger class
[mv] several certificate dependent constants to managers/certificate.py
[add] CherryPy BackgroundTask to invoke certificate check hourly (3600 secs)
[fix] tests
[fix] bug with txn timer clean (clean_txn_by_timeout, worker and invoking of it)
2025-04-01 18:03:07 +04:00
Alexander Presnyakov
de7a4a2d7e feat(mcs): add -v option to enable logging to console
refactor(ci): switch S3 uploading to AWS CLI for logging S3 link

docs: update README with to reflect changes in Drone pipeline

feat(env): add activate script for portable Python

fix(logging): log RequestException response body
2025-03-31 16:54:46 +00:00
Alan Mologorsky
6efffef765 MCOL-5594: Duplicate to stable-23.10 (#3222)
* MCOL-5594: Interactive "mcs cluster stop" command for CMAPI. (#3024)

* MCOL-5594: Interactive "mcs cluster stop" command for CMAPI.

[add] NodeProcessController class to handle Node operations
[add] two endpoints: stop_dmlproc (PUT) and is_process_running (GET)
[add] NodeProcessController.put_stop_dmlproc method to separately stop DMLProc on primary Node
[add] NodeProcessController.get_process_running method to check if specified process running or not
[add] build_url function to helpers.py. It needed to build urls with query_params
[add] MCSProcessManager.gracefully_stop_dmlproc method
[add] MCSProcessManager.is_service_running method as a top level wrapper to the same method in dispatcher
[fix] MCSProcessManager.stop by using new gracefully_stop_dmlproc
[add] interactive option and mode to mcs cluster stop command
[fix] requirements.txt with typer version to 0.9.0 where supports various of features including "Annotated"
[fix] requirements.txt click version (8.1.3 -> 8.1.7) and typing-extensions (4.3.0 -> 4.8.0). This is dependencies for typer package.
[fix] multiple minor formatting, docstrings and comments

* MCOL-5594: Add new CMAPI transaction manager.

- [add] TransactionManager ContextDecorator to manage transactions in less code and in one place
- [add] TransactionManager to cli cluster stop command and to API cluster shutdown command
- [fix] id -> txn_id in ClusterHandler class
- [fix] ClusterHandler.shutdown class to use inside existing transaction
- [add] docstrings in multiple places

* MCOL-5594: Review fixes.

* fix(cmapi): MCOL-5594: Fix after testing.. (#3150)

- [fix] wrong invoke already imported constants and function from signal lib
2024-06-27 14:32:50 +04:00
Roman Nozdrin
3046f7f952 fix(cmapi): handle an exception seen in CMAPI at RHEL 8 2024-05-21 16:19:30 +04:00
Leonid Fedorov
d2d0e08690 Fixed stdout and stderr forking porcs handling 2023-06-16 04:38:09 +03:00
mariadb-AlanMologorsky
a079a2c944 MCOL-5496: Merge CMAPI code to engine repo.
[add] cmapi code to engine
2023-06-07 10:00:16 +03:00