Commit Graph

37 Commits

Author SHA1 Message Date
jennifersp
4c704c3dae add SchemaName to DatabaseSchema interface (#8062) 2024-06-25 15:35:14 -07:00
Jason Fulghum
039a79d811 Updating tests for addition of performance_schema 2024-06-24 14:18:08 -07:00
Maximilian Hoffman
5600e2689f Fix nil write session panic (#7792)
* Fix nil write session panic

* invert check

* zach comments

* [ga-format-pr] Run go/utils/repofmt/format_repo.sh and go/Godeps/update.sh

---------

Co-authored-by: max-hoffman <max-hoffman@users.noreply.github.com>
2024-04-29 17:23:54 -07:00
Aaron Son
f77d4c494a go: sqle/cluster: When in standby mode, take the epoch of the primary. When in detected_broken_config, become standby if we see a higher numbered primary. 2024-02-09 14:32:06 -08:00
Aaron Son
b7b3f7b911 integration-tests/go-sql-server-driver: Fix tests. 2023-12-15 13:55:24 -08:00
Aaron Son
09d9d0312e integration-tests/go-sql-server-driver: Small tweak for TestCluster/adding_new_remotes_to_the_config_creates_those_remotes_on_startup. 2023-12-15 13:03:28 -08:00
Aaron Son
0fbfd0d80a go: sqle: cluster: Create missing remotes for cluster replication on startup if they do not already exist.
Previously `dolt sql-server` would error if there were existing databases and
they were missing any of the remotes listed as cluster replication remotes in
the config.yaml. This changes it so that those remotes are automatically
created at startup instead.
2023-12-15 12:49:11 -08:00
Aaron Son
bbe8070270 integration-tests/go-sql-server-driver: sql-server-cluster.yaml: Add a test for dolt_cluster_transition_to_standby when there are no dolt databases. 2023-10-18 14:40:24 -07:00
Aaron Son
0c72ec5205 go: sqle: cluster: Take mysql and dolt_branch_control replication state into account when performing a graceful transition to standby. 2023-10-17 15:01:46 -07:00
Aaron Son
dcc009509e Merge remote-tracking branch 'origin/fulghum/undrop' into aaron/undrop-cluster-tests 2023-10-06 17:20:15 -07:00
Aaron Son
b381903a2f integration-tests/go-sql-server-driver: Add a test for undropping a cluster replicated database. 2023-10-04 10:14:20 -07:00
Aaron Son
7d412a14e8 go: sqle: cluster: Improvements for DROP DATABASE replication.
Fix a bug in session handling for the replication api endpoint which would
prevent a dropped database from being recreated on a replica.

Fix a race condition when a database is recreated after it is dropped. In that
case, we stop attempting to replicate the drop, so that it does not replicate
after the new database does.
2023-10-03 14:50:57 -07:00
Aaron Son
e4aa6ffad8 go/libraries/doltcore/sqle/cluster: First pass at replicating drop database. 2023-09-29 14:14:09 -07:00
Aaron Son
3b0ca8bb21 go/libraries/doltcore/sqle: cluster: When a database is dropped, shutdown the replication goroutines and stop returning its status in the dolt_cluster_status table. 2023-09-20 15:47:46 -07:00
Aaron Son
155884711e sqle: cluster: dolt_cluster_transition_to_standby: Add logic to respect and enforce minCaughtUpReplicas. 2023-06-21 16:29:45 -07:00
Aaron Son
0a7cd7e033 sqle: cluster: dolt_cluster_transition_to_standby: Register the implementation (without transition transition thresholds) and test it. 2023-06-21 16:03:59 -07:00
Aaron Son
6ea915ca4d Merge remote-tracking branch 'origin/main' into aaron/block-on-cluster-replication 2023-05-16 16:57:09 -07:00
Aaron Son
6ccae75a8d integration-tests/go-sql-server-driver: Add TestCluster/last_updated_heartbeats test which asserts that last_updated does not grow while there are no writes to replicate. 2023-05-16 14:21:41 -07:00
Aaron Son
535e59141d integration-tests/go-sql-server-driver: Cluster, dolt_cluster_ack_writes_timeout_secs, add a failing test to assert that dolt_branch modifications are waited on. 2023-05-15 14:00:04 -07:00
Aaron Son
dfdb4a4b2a go: sqle: cluster: Implement a first pass at dolt_cluster_ack_writes_timeout_secs.
Setting this system variable to a non-zero value on a primary replica in a
sql-server cluster will cause dolt to block a SQL client performing a commit
until that client's commit is fully replicated to the replicas.

If there is a timeout, currently a warning is logged in the logs.
2023-05-11 15:50:43 -07:00
Aaron Son
6e6ed1b77b Fix result ordering in integration test. 2023-05-09 14:08:19 -07:00
Aaron Son
acf99f1edf go: sqle: dolt_gc.go: Disable CALL dolt_gc() on a standby replica, where it is not currently safe. Shallow GC is still available. 2023-05-09 13:41:16 -07:00
Zach Musgrave
75b1395510 New integration test ala aaron 2023-05-05 07:42:32 -07:00
Aaron Son
1d0a6001ac go/libraries/doltcore/sqle: database_provider.go: When cloning a remote into a sql-server, always run the InitDatabaseHook on it.
Failing to run the hook means that the cloned database is not appropriately
configured for replication, for example.

Fixes: #5850
2023-05-01 12:42:02 -07:00
Aaron Son
f7c69bf881 Merge pull request #4749 from dolthub/aaron/cluster-jwks-auth
go/libraries/doltcore/sqle/cluster: Add JWT authentication for peer communication to cluster replicas.
2022-11-15 12:21:55 -08:00
Aaron Son
6d7a569e61 integration-tests/go-sql-server-driver: Use 385{1,2} instead of 5005{1,2} for cluster remotesapi ports. 2022-11-10 16:34:49 -08:00
Aaron Son
b22fbf11f2 go/libraries/doltcore/sqle/cluster: Add JWT authentication for peer communication to cluster replicas.
A remotesapi server running on a cluster replica publishes a JWKS.

Every outbound GRPC call the cluster replica makes includes a JWT signed with a
private key.

remotesapi servers running on cluster replicas require and validate incoming
JWTs for cluster traffic. The set of valid signing keys is taken from the
JWKSes which are published at /.well-known/jwks.json on the standby replica
hosts.

It is possible to configure tls_ca on cluster remotesapi to configure the set
of trusted roots for outbound TLS connections. Because the JWKSes are served
over the same connection, and becuase signed JWTs are not replay resistent, TLS
is recommended for all deployment topologies.
2022-11-10 09:26:38 -08:00
Aaron Son
248be8b21a go/libraries/doltcore/sqle/cluster: Add the ability to configure SAN assertions on URIs and DNS names in the server certificate when configuring TLS. 2022-10-28 10:31:14 -07:00
Aaron Son
27a528e498 go/libraries/doltcore/sqle/cluster: Add support for configured tls_{cert,key,ca} on the cluster.remotesapi.
For now, this is server-side TLS, not mTLS.

If a tls_ca is configured, the certificates in that file are PEM encoded. They
are the only trusted roots for server certificate verification on both gRPC and
HTTP connections. If tls_ca is set, no server name verification is done for
now.
2022-10-26 16:13:51 -07:00
Aaron Son
995e3818cd go: sqle: remotesrv: Successfully replicate CREATE DATABASE commands by instantiating new databases on the standby on demand. 2022-10-05 12:37:39 -07:00
Aaron Son
cc82355269 integration-tests/go-sql-server-driver: Fix JSON test for LD_1. 2022-10-04 11:49:11 -07:00
Aaron Son
c56b0630a9 integration-tests/go-sql-server-driver: Finish transitioning the rest of the sql-server-cluster tests. 2022-10-04 10:22:38 -07:00
Aaron Son
fa7db054ad integration-tests/go-sql-server-driver: Convert some more sql-server-cluster.bats tests. 2022-10-03 17:23:53 -07:00
Aaron Son
bf7480eb1b integration-tests/go-sql-server-driver: sql-server-cluster.yaml: Fix dolt_assume_cluster_role tests for new behavior of not breaking connection when role does not change. 2022-10-03 15:02:40 -07:00
Aaron Son
7ebc1bb45f integration-tests/go-sql-server-driver: Move Server definitions to TestRepo/MultiRepo, instead of a separate top-level field. 2022-10-03 12:04:35 -07:00
Aaron Son
87de2bb7d9 integration-tests/go-sql-server-driver: Add retry_attempts functionality, drop sleep_millis. Add some documentation. 2022-10-03 11:38:01 -07:00
Aaron Son
cf639c3585 integration-tests/go-sql-server-driver: Start converting some sql-server bats tests. 2022-10-03 10:01:47 -07:00