Skip to content

Commit bbce63e

Browse files
Addressing comments
1 parent 67d8944 commit bbce63e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+60
-88
lines changed

.gitignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,10 @@ test/proxysql/*.log*
4444
# Coverage files
4545
test/coverage
4646

47-
# Database config symlinks
48-
sa/db/dbconfig.yml
49-
test/secrets/backfiller_dburl
47+
# DSN symlinks
5048
test/secrets/badkeyrevoker_dburl
5149
test/secrets/cert_checker_dburl
52-
test/secrets/expiration_mailer_dburl
5350
test/secrets/incidents_dburl
54-
test/secrets/mailer_dburl
55-
test/secrets/ocsp_responder_dburl
5651
test/secrets/revoker_dburl
5752
test/secrets/sa_dburl
5853
test/secrets/sa_ro_dburl

sa/database_test.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ import (
1717
"github.com/letsencrypt/boulder/test/vars"
1818
)
1919

20-
var dbHost = os.Getenv("MYSQL_ADDR")
21-
2220
func TestInvalidDSN(t *testing.T) {
2321
_, err := DBMapForTest("invalid")
2422
test.AssertError(t, err, "DB connect string missing the slash separating the database name")

sa/db-next/dbconfig.mysql8.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../db/dbconfig.mysql8.yml

sa/db-next/dbconfig.yml

Lines changed: 0 additions & 1 deletion
This file was deleted.

sa/db/dbconfig.mariadb.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# https://github.com/rubenv/sql-migrate#readme
22
boulder_sa_test:
33
dialect: mysql
4-
datasource: root@tcp(boulder-proxysql:6033)/boulder_sa_test?parseTime=true&max_statement_time=15&long_query_time=12
4+
datasource: root@tcp(boulder-proxysql:6033)/boulder_sa_test?parseTime=true
55
dir: boulder_sa
66

77
boulder_sa_integration:
88
dialect: mysql
9-
datasource: root@tcp(boulder-proxysql:6033)/boulder_sa_integration?parseTime=true&max_statement_time=15&long_query_time=12
9+
datasource: root@tcp(boulder-proxysql:6033)/boulder_sa_integration?parseTime=true
1010
dir: boulder_sa
1111

1212
incidents_sa_test:
1313
dialect: mysql
14-
datasource: root@tcp(boulder-proxysql:6033)/incidents_sa_test?parseTime=true&max_statement_time=15&long_query_time=12
14+
datasource: root@tcp(boulder-proxysql:6033)/incidents_sa_test?parseTime=true
1515
dir: incidents_sa
1616

1717
incidents_sa_integration:
1818
dialect: mysql
19-
datasource: root@tcp(boulder-proxysql:6033)/incidents_sa_integration?parseTime=true&max_statement_time=15&long_query_time=12
19+
datasource: root@tcp(boulder-proxysql:6033)/incidents_sa_integration?parseTime=true
2020
dir: incidents_sa

sa/db/dbconfig.mysql8.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# https://github.com/rubenv/sql-migrate#readme
22
boulder_sa_test:
33
dialect: mysql
4-
datasource: root@tcp(boulder-vitess:33577)/boulder_sa_test?parseTime=true&max_execution_time=13000&long_query_time=11
4+
datasource: root@tcp(boulder-vitess:33577)/boulder_sa_test?parseTime=true
55
dir: boulder_sa
66

77
boulder_sa_integration:
88
dialect: mysql
9-
datasource: root@tcp(boulder-vitess:33577)/boulder_sa_integration?parseTime=true&max_execution_time=13000&long_query_time=11
9+
datasource: root@tcp(boulder-vitess:33577)/boulder_sa_integration?parseTime=true
1010
dir: boulder_sa
1111

1212
incidents_sa_test:
1313
dialect: mysql
14-
datasource: root@tcp(boulder-vitess:33577)/incidents_sa_test?parseTime=true&max_execution_time=13000&long_query_time=11
14+
datasource: root@tcp(boulder-vitess:33577)/incidents_sa_test?parseTime=true
1515
dir: incidents_sa
1616

1717
incidents_sa_integration:
1818
dialect: mysql
19-
datasource: root@tcp(boulder-vitess:33577)/incidents_sa_integration?parseTime=true&max_execution_time=13000&long_query_time=11
19+
datasource: root@tcp(boulder-vitess:33577)/incidents_sa_integration?parseTime=true
2020
dir: incidents_sa

sa/sa.go

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1228,14 +1228,6 @@ func (ssa *SQLStorageAuthority) UpdateCRLShard(ctx context.Context, req *sapb.Up
12281228
nextUpdate = &nut
12291229
}
12301230

1231-
// MariaDB and MySQL 8 handle fractional seconds differently in DATETIME(0)
1232-
// columns: MariaDB truncates while MySQL rounds to the nearest second. To
1233-
// ensure both databases store identical values, we explicitly truncate to
1234-
// whole seconds here. Without this, MySQL could round a timestamp up to the
1235-
// next second, causing a subsequent update within the same second to appear
1236-
// "older" and be rejected.
1237-
thisUpdate := req.ThisUpdate.AsTime().Truncate(time.Second)
1238-
12391231
_, err := db.WithTransaction(ctx, ssa.dbMap, func(tx db.Executor) (any, error) {
12401232
res, err := tx.ExecContext(ctx,
12411233
`UPDATE crlShards
@@ -1244,12 +1236,12 @@ func (ssa *SQLStorageAuthority) UpdateCRLShard(ctx context.Context, req *sapb.Up
12441236
AND idx = ?
12451237
AND (thisUpdate is NULL OR thisUpdate <= ?)
12461238
LIMIT 1`,
1247-
thisUpdate,
1239+
req.ThisUpdate.AsTime(),
12481240
nextUpdate,
1249-
thisUpdate,
1241+
req.ThisUpdate.AsTime(),
12501242
req.IssuerNameID,
12511243
req.ShardIdx,
1252-
thisUpdate,
1244+
req.ThisUpdate.AsTime(),
12531245
)
12541246
if err != nil {
12551247
return nil, err

sa/sysvars.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,6 @@ func checkMariaDBSystemVariables(name string, value string) error {
105105
"max_sort_length": {},
106106
"max_sp_recursion_depth": {},
107107
"max_statement_time": {},
108-
"max_execution_time": {},
109108
"max_user_connections": {},
110109
"min_examined_row_limit": {},
111110
"mrr_buffer_size": {},

sa/sysvars_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ func TestCheckMariaDBSystemVariables(t *testing.T) {
1515

1616
for _, tc := range []testCase{
1717
{"sql_select_limit", "'0.1", "requires a numeric value"},
18+
{"max_statement_time", "0", ""},
1819
{"myBabies", "kids_I_tell_ya", "was unexpected"},
1920
{"sql_mode", "'STRICT_ALL_TABLES", "string is not properly quoted"},
2021
{"sql_mode", "%27STRICT_ALL_TABLES%27", "string is not properly quoted"},

test.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,9 @@ FILTER=()
2323
COVERAGE="false"
2424
COVERAGE_DIR="test/coverage/$(date +%Y-%m-%d_%H-%M-%S)"
2525
DB_URL_FILES=(
26-
backfiller_dburl
2726
badkeyrevoker_dburl
2827
cert_checker_dburl
29-
expiration_mailer_dburl
3028
incidents_dburl
31-
mailer_dburl
32-
ocsp_responder_dburl
3329
revoker_dburl
3430
sa_dburl
3531
sa_ro_dburl
@@ -92,23 +88,20 @@ function run_and_expect_silence() {
9288
}
9389

9490
configure_database_endpoints() {
95-
target_dir="mariadb"
96-
dbconfig_target="dbconfig.mariadb.yml"
91+
dburl_target_dir="proxysql"
9792
export DB_ADDR="boulder-proxysql:6033"
9893

9994
if [[ "${USE_VITESS}" == "true" ]]
10095
then
101-
target_dir="mysql8"
102-
dbconfig_target="dbconfig.mysql8.yml"
96+
dburl_target_dir="vitess"
10397
export DB_ADDR="boulder-vitess:33577"
10498
fi
10599

106-
rm -f "sa/db/dbconfig.yml" test/secrets/*.dburl || true
107-
( cd sa/db && ln -sf "${dbconfig_target}" "dbconfig.yml" )
108-
100+
# Configure DBURL symlinks
101+
rm -f test/secrets/*_dburl || true
109102
for file in ${DB_URL_FILES:+${DB_URL_FILES[@]+"${DB_URL_FILES[@]}"}}
110103
do
111-
( cd test/secrets && ln -sf "../dburls/${target_dir}/${file}" "${file}" )
104+
ln -sf "dburls/${dburl_target_dir}/${file}" "test/secrets/${file}"
112105
done
113106
}
114107
#

0 commit comments

Comments
 (0)