Skip to content

Commit

Permalink
Changed path to mysql config file
Browse files Browse the repository at this point in the history
Updated mysql config file
Deprecated mysql module.
Created Changelog for v3.26.2
  • Loading branch information
chrisekelley committed Dec 8, 2022
1 parent 12a4ba7 commit ba53b3a
Show file tree
Hide file tree
Showing 6 changed files with 63 additions and 7 deletions.
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,43 @@
# What's new

## v3.26.2

__DEPRECATION NOTICE AND UPCOMING MODULE DELETION__

The mysql module is deprecated; it will be removed *soon* from this source code in the v3.28.0 release.
We have been using the mysql-js in production for a few months and it is more performant
and reliable that the output of the mysql module. We recommend switching to the mysql-js module.
See the [MySQL-JS Module doc](./docs/system-administrator/mysql-js.md) for upgrade and configuration information.

__Fixes__
- Fix for Mysql tables not populating; ER_TOO_BIG_ROWSIZE error in tangerine logs [#3488](https://github.com/Tangerine-Community/Tangerine/issues/3488)
- Changed location of mysql-js config file to point to the mysql-js directory. Also increased memory parameters in conf.d/config-file.cnf.
- Fix for CSV Download fails with larger forms [#3483](https://github.com/Tangerine-Community/Tangerine/issues/3483)

__Server upgrade instructions__

Reminder: Consider using the [Tangerine Upgrade Checklist](https://docs.tangerinecentral.org/system-administrator/upgrade-checklist.html) for making sure you test the upgrade safely.

```
cd tangerine
# Check the size of the data folder.
du -sh data
# Check disk for free space. Ensure there is at least 10GB + size of the data folder amount of free space in order to perform the upgrade.
df -h
# Turn off tangerine and database.
docker stop tangerine couchdb
# Create a backup of the data folder.
cp -r data ../data-backup-$(date "+%F-%T")
# Check logs for the past hour on the server to ensure it's not being actively used. Look for log messages like "Created sync session" for Devices that are syncing and "login success" for users logging in on the server.
docker logs --since=60m tangerine
# Fetch the updates.
git fetch origin
git checkout v3.26.2
./start.sh v3.26.2
# Remove Tangerine's previous version Docker Image.
docker rmi tangerine/tangerine:v3.26.1
```

## v3.26.1

__NEW Features__
Expand Down
2 changes: 1 addition & 1 deletion mysql-start-container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@ fi
[ "$(docker ps | grep $T_MYSQL_CONTAINER_NAME)" ] && docker stop $T_MYSQL_CONTAINER_NAME
[ "$(docker ps -a | grep $T_MYSQL_CONTAINER_NAME)" ] && docker rm $T_MYSQL_CONTAINER_NAME

docker run -v $(pwd)/server/src/modules/mysql/conf.d:/etc/mysql/conf.d --name "$T_MYSQL_CONTAINER_NAME" -v "$(pwd)/data/mysql/databases:/var/lib/mysql" -p 3306:3306 -e "MYSQL_ROOT_PASSWORD=$T_MYSQL_PASSWORD" -d mysql:latest
docker run -v $(pwd)/server/src/modules/mysql-js/conf.d:/etc/mysql/conf.d --name "$T_MYSQL_CONTAINER_NAME" -v "$(pwd)/data/mysql/databases:/var/lib/mysql" -p 3306:3306 -e "MYSQL_ROOT_PASSWORD=$T_MYSQL_PASSWORD" -d mysql:latest

4 changes: 4 additions & 0 deletions server/src/modules/mysql-js/conf.d/config-file.cnf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[mysqld]
innodb-strict-mode=OFF
innodb-page-size=32K
innodb-log-buffer-size=128M
14 changes: 11 additions & 3 deletions server/src/modules/mysql-js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,16 @@ module.exports = {
const { groupNames } = data
for (let i = 0; i < groupNames.length; i++) {
const groupName = groupNames[i]
await removeGroupForMySQL(groupName)
await initializeGroupForMySQL(groupName)
try {
await removeGroupForMySQL(groupName)
} catch (e) {
console.log("error: " + e)
}
try {
await initializeGroupForMySQL(groupName)
} catch (e) {
console.log("error: " + e)
}
}
return data
},
Expand Down Expand Up @@ -879,7 +887,7 @@ async function insertDocument(groupId, knex, tableName, data, primaryKey) {
// const e = SqlString.escapeId(dataKeys[i], true)
// dataKeys[i] = e
if (!infoKeysLower.includes(e.toLowerCase())) {
log.info(`Adding column ${e} new name: ${dataKeys[i]} to table ${tableName}`)
log.info(`Adding new column ${e} to table ${tableName}`)
try {
await knex.schema.withSchema(groupId.replace(/-/g, '')).alterTable(tableName, function (t) {
t.text(e)
Expand Down
8 changes: 6 additions & 2 deletions server/src/modules/mysql/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
Python code to convert Tangerine (CouchDB database) documnets to MySQL database. Each document type maps to one database table.
# DEPRECATED Mysql Module

## This module is deprecated as of v3.26.2 and will be removed in v3.28.0.

Python code to convert Tangerine (CouchDB database) documents to MySQL database. Each document type maps to one database table.
CreateTable.sql script needs to be run in each MySQL database so that the 4 basic tables are created. Tangerine response form table willbe created on the fly.
The python code updates the database tables (schema and data) on the fly.
Delete is curently not supported.
It pulls on CouchDB changes on a set time intervals and process the changes only after the initial synchronization.

TangerineToMySQL.py: it uses the setting.ini for One tangerine couchDB database to one MySQL database conversion
MultipleTangerineToMySQL.py: it uses setting2.ini that convetts multiple couchDBdatabase to multiple MySQL database, it doesn't fully working yet, still more to do.
MultipleTangerineToMySQL.py: it uses setting2.ini that converts multiple couchDB databases to multiple MySQL database, it doesn't fully work yet, still more to do.
4 changes: 3 additions & 1 deletion server/src/modules/mysql/conf.d/config-file.cnf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
[mysqld]
default-storage-engine=myisam
innodb-strict-mode=OFF
innodb-page-size=32K
innodb-log-buffer-size=128M

0 comments on commit ba53b3a

Please sign in to comment.