From 84e23b52904185355e9d975e4570211df6533c0f Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 4 May 2020 14:57:09 +0530 Subject: [PATCH 1/3] db.properties: Enforce UTC timezone by default This would give users ability to change the timezone Signed-off-by: Rohit Yadav --- client/conf/db.properties.in | 2 +- utils/conf/db.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/conf/db.properties.in b/client/conf/db.properties.in index 2f1dcf0d6b84..1621a964f0cd 100644 --- a/client/conf/db.properties.in +++ b/client/conf/db.properties.in @@ -39,7 +39,7 @@ db.cloud.testWhileIdle=true db.cloud.timeBetweenEvictionRunsMillis=40000 db.cloud.minEvictableIdleTimeMillis=240000 db.cloud.poolPreparedStatements=false -db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' +db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useTimezone=true&serverTimezone=UTC # CloudStack database SSL settings db.cloud.useSSL=false diff --git a/utils/conf/db.properties b/utils/conf/db.properties index 2fd6910368a6..8f05c30b07df 100644 --- a/utils/conf/db.properties +++ b/utils/conf/db.properties @@ -44,7 +44,7 @@ db.cloud.testWhileIdle=true db.cloud.timeBetweenEvictionRunsMillis=40000 db.cloud.minEvictableIdleTimeMillis=240000 db.cloud.poolPreparedStatements=false -db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION' +db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useTimezone=true&serverTimezone=UTC # usage database settings db.usage.username=cloud From 90e3a68ddf0de76eda3fce358027676b01447b2d Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 4 May 2020 15:15:53 +0530 Subject: [PATCH 2/3] fix server time to UTC Signed-off-by: Rohit Yadav --- client/conf/db.properties.in | 2 +- utils/conf/db.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/client/conf/db.properties.in b/client/conf/db.properties.in index 1621a964f0cd..e904345830d1 100644 --- a/client/conf/db.properties.in +++ b/client/conf/db.properties.in @@ -39,7 +39,7 @@ db.cloud.testWhileIdle=true db.cloud.timeBetweenEvictionRunsMillis=40000 db.cloud.minEvictableIdleTimeMillis=240000 db.cloud.poolPreparedStatements=false -db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useTimezone=true&serverTimezone=UTC +db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&serverTimezone=UTC # CloudStack database SSL settings db.cloud.useSSL=false diff --git a/utils/conf/db.properties b/utils/conf/db.properties index 8f05c30b07df..0fa403f14e65 100644 --- a/utils/conf/db.properties +++ b/utils/conf/db.properties @@ -44,7 +44,7 @@ db.cloud.testWhileIdle=true db.cloud.timeBetweenEvictionRunsMillis=40000 db.cloud.minEvictableIdleTimeMillis=240000 db.cloud.poolPreparedStatements=false -db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&useTimezone=true&serverTimezone=UTC +db.cloud.url.params=prepStmtCacheSize=517&cachePrepStmts=true&prepStmtCacheSqlLimit=4096&sessionVariables=sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'&serverTimezone=UTC # usage database settings db.usage.username=cloud From c4d711c22c47f06ec80333b23e6231ea2d8e28fd Mon Sep 17 00:00:00 2001 From: Rohit Yadav Date: Mon, 4 May 2020 15:48:24 +0530 Subject: [PATCH 3/3] Update the db.usage.url.params=serverTimezone=UTC per Liridon's testing Signed-off-by: Rohit Yadav --- client/conf/db.properties.in | 2 +- utils/conf/db.properties | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/client/conf/db.properties.in b/client/conf/db.properties.in index e904345830d1..7ef25afd0382 100644 --- a/client/conf/db.properties.in +++ b/client/conf/db.properties.in @@ -64,7 +64,7 @@ db.usage.name=cloud_usage db.usage.maxActive=100 db.usage.maxIdle=30 db.usage.maxWait=10000 -db.usage.url.params= +db.usage.url.params=serverTimezone=UTC # Simulator database settings db.simulator.username=@DBUSER@ diff --git a/utils/conf/db.properties b/utils/conf/db.properties index 0fa403f14e65..3ed7039fc445 100644 --- a/utils/conf/db.properties +++ b/utils/conf/db.properties @@ -60,6 +60,7 @@ db.usage.maxActive=100 db.usage.maxIdle=30 db.usage.maxWait=10000 db.usage.autoReconnect=true +db.usage.url.params=serverTimezone=UTC # Simulator database settings db.simulator.username=cloud