1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-10-30 07:25:34 +03:00
Commit Graph

82 Commits

Author SHA1 Message Date
drrtuy
99392ed87f fix(cmapi,systemd): pre-save locks cleanup has been moved into mcs-savebrm.py (#3794) 2025-10-07 12:31:23 +01:00
mariadb-AlanMologorsky
f8678ff51f fix(cs_package_manager): RHEL install
Do not download MariaDB-server for RHEL installation
Fix yum repo by adding module_hotfixes = 1
2025-10-02 04:09:51 +04:00
mariadb-AlanMologorsky
c86586c228 feat(cmapi,failover): MCOL-6006 Disable failover when shared storage not detected
- Add SharedStorageMonitor thread to periodically verify shared storage:
  * Writes a temp file to the shared location and validates MD5 from all nodes.
  * Skips nodes with unstable recent heartbeats; retries once; defers decision if any node is unreachable.
  * Updates a cluster-wide stateful flag (shared_storage_on) only on conclusive checks.
- New CMAPI endpoints:
  * PUT /cmapi/{ver}/cluster/check-shared-storage — orchestrates cross-node checks.
  * GET /cmapi/{ver}/node/check-shared-file — validates a given file’s MD5 on a node.
  * PUT /cmapi/{ver}/node/stateful-config — fast path to distribute stateful config updates.
- Introduce in-memory stateful config (AppStatefulConfig) with versioned flags (term/seq) and shared_storage_on flag:
  * Broadcast via helpers.broadcast_stateful_config and enhanced broadcast_new_config.
  * Config PUT is now validated with Pydantic models; supports stateful-only updates and set_mode requests.
- Failover behavior:
  * NodeMonitor keeps failover inactive when shared_storage_on is false or cluster size < 3.
  * Rebalancing DBRoots becomes a no-op when shared storage is OFF (safety guard).
- mcl status improvements: per-node 'state' (online/offline), better timeouts and error reporting.
- Routing/wiring: add dispatcher routes for new endpoints; add ClusterModeEnum.
- Tests: cover shared-storage monitor (unreachable nodes, HB-based skipping), node manipulation with shared storage ON/OFF, and server/config flows.
- Dependencies: add pydantic; minor cleanups and logging.
2025-10-01 21:10:34 +04:00
mariadb-AlanMologorsky
a76e153a1d feat(upgrade): MCOL-6028 upgrade MVP with repo-managed flow, prechecks, and other enhancements
Implements the initial upgrade capability across CMAPI and the CLI, including
repository setup, package operations, environment prechecks, and coordinated
cluster steps with progress reporting.

Details:
- CMAPI upgrade manager:
  - Add `cmapi/cmapi_server/managers/upgrade/` modules:
    - `repo.py`, `packages.py`, `preinstall.py`, `upgrade.py`, `utils.py` and `__init__.py`
  - Extend endpoints and routing to expose upgrade operations and status:
    - `cmapi_server/controllers/{endpoints.py, dispatcher.py, api_clients.py}`
    - `cmapi_server/managers/{application.py, process.py}`
    - Add improved constants and helpers for upgrade flow
- Backup/restore and safety:
  - Add `cmapi_server/managers/backup_restore.py`
  - Fix pre-upgrade backup regressions (due to `mcs_backup_manager.sh 3.17 changes`)
  - Improve cluster version validation; add `ignore_missmatch` override
- CLI enhancements:
  - Progress UI and richer feedback (`mcs_cluster_tool/tools_commands.py`, `README.md`, `mcs.1`)
  - Add steps to start MDB and start MCS during/after upgrade
  - Improved error surfacing for version validation
- Platform and packaging:
  - Ubuntu and Rocky Linux support
  - RHEL/DNF dry-run support
  - Distro detection and platform-dependent logic hardened
  - Logging improvements
- Updater service:
  - Add `cmapi/updater/cmapi_updater.service.template` and `cmapi_updater.sh` to make CMAPI update itself
- Docs:
  - Update mcs cli README and mcs.1 man file
  - Add `cmapi/updater/README.md`
2025-09-30 18:48:32 +04:00
mariadb-AlanMologorsky
0753aac849 fix(cmapi): Fix error in docker cluster: "is not currently part of the cluster" 2025-09-26 21:55:10 +04:00
Alexander Presnyakov
bc4c7e27d9 MCOL-5806: added ability to start node in read-only mode
* feat(cmapi): add read_only param for API add node endpoint
* style(cmapi): fixes for string length and quotes

Add dbroots of other nodes to the read-only node

On every node change adjust dbroots in the read-only nodes

Fix logging (trace level) in tests

Remove ExeMgr from constants

Fix tests

Manually remove read-only node from ReadOnlyNodes on node removal (because nodes are only deactivated)

Review fixes (mostly switching to StrEnum analog before py3.11, also changes in ruff config)

Read-only nodes are now called read replica consistently

Don't write hostname into IP fields of the config like PMSx/IPAddr, pmx_WriteEngineServer/IPAddr

We calculate ReadReplicas by finding PMs without WriteEngineServer

In _replace_localhost, replace local IP addrs with resolved IP addrs and local hostnames -- with the resolved hostnames.
ModuleHostName/ModuleIPAddr is kept intact.

Keep only IPv4 in ActiveNodes/DesiredNodes/InactiveNodes

feat: add mock DNS resolution builder for testing hostname/IP mappings

* Fix _add_node_to_PMS: if node is already in PMS, save it to existing items to not miss it during the reconstruction of the list
* Make tests independent from CWD

Fixed for _add_Module_entries

Fixed node removal and tests

Fixes for node manipulation tests
2025-09-26 21:55:10 +04:00
Allen Herrera
e75f86058d update mcs_backup_manager_v3.18 - dbrm_restore - fixed issue with it trying to apply locks while database is offline resulting in a failed restore 2025-09-22 16:39:39 +04:00
mariadb-AlanMologorsky
e8b9adda8f fix(config): MCOL-5508 Fixed missing DBRMUnresponsiveTimeout tag in some of .xml config files. 2025-09-18 17:16:40 +03:00
Alexander Presnyakov
4422cf04b2 Just a debug logging telling that no locks remain 2025-09-18 13:05:16 +00:00
Alexander Presnyakov
a357566db7 Use is_only_loopback_hostname instead of LOCALHOSTS 2025-09-18 01:10:49 +00:00
Alexander Presnyakov
85690a0de1 refactor: standardize error handling with new context managers for CMAPI exceptions
We do it for the API to return error details.
2025-09-17 17:58:51 +00:00
Alexander Presnyakov
4a1b3b9355 feat: add forward/reverse DNS validation when adding nodes by hostname 2025-09-17 17:58:51 +00:00
Alexander Presnyakov
ade880fe78 Return original default value of deactivate_only (False) 2025-09-11 19:49:31 +04:00
Alexander Presnyakov
8fadbf2819 Fix downloading libmariadb-dev when --with-dev is passed 2025-09-10 18:58:11 +00: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
38d7f6a51c Added an option to cs_package manager to enable downloading\installing dev packages 2025-09-10 09:06:20 +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
873eeb172c CLI command to enable/disable Sentry logging 2025-09-03 20:32:03 +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
3ca5a2e6bb Fixed Sentry transaction continuation 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
Leonid Fedorov
15944923bd chore(cmapi runtime): add Network as a prerequisite to start CMAPI service 2025-08-28 03:45:46 +04:00
Leonid Fedorov
46922f8d6a chore(build, cmapi): fallback of packaging to os-release if lsb-core is missing 2025-08-28 03:45:46 +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
Allen Herrera
f0db98fbba 3.16 added retry rsync logic for backups, 3.17 improved dbrm backups with save_brm, write poll checks and write locks 2025-08-26 16:49:58 +04: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
Leonid Fedorov
6db2dc668f stubs and cmake formatting 2025-05-20 18:22:59 +04:00
mariadb-AlanMologorsky
2c0367ea2b feat(mcs): MCOL-5300 review/finetune log collection tools.
* chore(mcs, scripts): extra/columnstore_review.sh with scripts/columnstore_review.sh with 1.4.13 version
* feat(mcs): add review command to the Tools section. It's the wrapper for columnstore_review.sh
* feat(mcs): add review command implementation to tools.py file + constansts.py
* chore(mcs): add separator argument to cook_sh_arg function
* docs(mcs): updated README.md and mcs.1 man file
2025-05-02 16:12:14 +03:00
Allen Herrera
b731c0a326 chore(backup): spellcheck mcs_backup_manager.sh adjusting lots of variable names, functions and help text (#3515) 2025-04-21 18:27:04 +01:00
Allen Herrera
441327ed84 chore(cs_package_manager,backup): update cs_package_manager.sh to v 3.10 (#3498)
* update cs_package_manager.sh to v 3.10 - added download maxscale and check maxscale

* adjust cs_package_manager.sh rename ci variables
2025-04-21 15:26:12 +01:00
Alexander Presnyakov
e34f7d2530 Fix thread arg errors (app instead of sequence) 2025-04-18 18:52:42 +01:00
mariadb-AlanMologorsky
927eb4b2bd feat(cmapi, mcs): MCOL-5941 Improve mcs cli backup\restore wrapper.
* fix(mcs, wrapper): default is None for --backup-location, --backup-destination, --storage, --parallel, --highavilability, --skip-save-brm, --skip-polls, --skip-locks, --skip-mariadb-backup, --skip-bucket-data, --name-backup, --quiet, --no-verify-ssl, --poll-interval, --poll-max-wait, --retention-days, -scp, -bb, -url, -f, -m, -aro, -li and most of arguments in backup_commands.py and restore_commands.py
* fix(mcs, helpers): cook_sh_arg parser function now detects None as a value
* fix(mcs, wrapper): list -> li in typer command argument name for both backup_commands.py and restore_commands.py
* docs(mcs, wrapper): --parralel arg help message was edited to simple and readable one
* fix(mcs, wrapper): removing -no- prefixed flag variants for all bool arguments in backup_commands.py and restore_commands.py
2025-04-18 18:51:59 +01:00
mariadb-AlanMologorsky
7c27d803ba feat(cmapi, mcs): MCOL-5525 Single start command for Single Node.
* feat(mcs): new mcs bootstrap-single-node command added into tools pane
2025-04-15 04:57:12 +03:00
mariadb-AlanMologorsky
fde9155d18 chore(cmapi, deps): MCOL-5905 Bump versions of CMAPI dependencies. 2025-04-08 15:48:47 +03: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