Commit Graph

248 Commits

Author SHA1 Message Date
Aaron Son 820686bc42 Merge pull request #7004 from dolthub/aaron/sql-server-startup-rigor
[no-release-notes] cmd/dolt/commands/sqlserver: Restructure the start up sequence for sql-server.
2023-11-16 10:23:46 -08:00
Aaron Son f1b915af43 go/libraries/utils/svcs: Controller: Change Stop so it can be called concurrently and multiple times and it never returns an error. 2023-11-15 13:34:25 -08:00
Aaron Son a6c4815eee go/cmd/dolt/commands/sqlserver: Experiment with Service as an interface instead of a struct. Experiment with ServiceState and more rigorous cleanup of some services. 2023-11-15 11:45:22 -08:00
Zach Musgrave 5eab70e370 Merge pull request #6994 from nustiueudinastea/concurrent-remotes-map
Concurrent remotes map
2023-11-15 11:10:59 -08:00
Aaron Son 23dc3ed014 cmd/dolt/commands/sqlserver: Restructure the start up sequence for sql-server.
We explicitly model Services, which can have an Init step, a Run step and a
Stop step. Every registered service get initialized in the order they were
registered in, then they all run concurrently until Stop is called, when they
all get Stopped in reverse order. It's possible for clients to wait for init to
be completed and be delivered any errors encountered on startup. They can also
wait for stop, to be delivered any errors encountered on shutdown.
2023-11-14 16:58:55 -08:00
Alex Giurgiu 46fd1d3f8f added tests for the concurrent map 2023-11-14 12:52:11 +02:00
Alex Giurgiu 9358062a67 method docs 2023-11-13 21:42:28 +02:00
Alex Giurgiu 01165c66a9 renamed concurrent Map Range to Iter. It's a more commonly used name for this functionality 2023-11-13 21:36:27 +02:00
Alex Giurgiu 3afc0b4449 custom json (un)marshaller for the concurrent map. Necessary for correct json (un)marshalling 2023-11-13 21:24:50 +02:00
Alex Giurgiu fade899b6b added copyright header 2023-11-12 12:38:14 +02:00
Aaron Son faa0f91ba2 Fix for regression in relative base dir functionality of go/libraries/utils/filesys/localfs.go 2023-11-10 09:35:17 -08:00
Aaron Son 1dc224e325 [no-release-notes] go/libraries/utils/file: Small refactor so attempts to do atomic file writes use a common helper method. 2023-11-10 08:07:00 -08:00
Aaron Son 41bcbb93f7 go: filesys: Take a FileMode on WriteFile. Fix sql-server.lock file handling to not leak file handles and keep correct perms when creating the file. 2023-11-09 14:35:28 -08:00
Alex Giurgiu e3bead0cc3 switched everything to the concurrent map and not using snapshots anymore 2023-11-09 19:58:03 +02:00
Alex Giurgiu 5a6ba275e7 added a concurrent map implementation and using it to store the remotes 2023-11-09 15:11:57 +02:00
Aaron Son 41b738fcdf Change to use a crash resistant, atomic file update protocol for a number of file writes.
Makes updates to branch_control, repo_state.json and some persisted config
files atomic and crash resistant.
2023-11-08 15:18:34 -08:00
Aaron Son 53d05f4a60 go/libraries/doltcore/sqle/mysql_file_handler: fsync the directory inode after the chmod+rename. 2023-11-08 14:58:38 -08:00
Aaron Son b083c24d69 dbfactory: aws: For AWS remotes using an explicit file credentials, periodically refresh the credentials the AWS client uses from the file contents.
Some use cases put attenuated, expiring credentials into files. It's nice to
pick up the new credentials without needing to recreate the client.
2023-10-23 16:54:55 -07:00
Jason Fulghum a47c4f8b7c PR feedback: removing some duplication around use of TryLock to assert that mutexes are locked and adding some extra comments. 2023-10-09 16:29:35 -07:00
Jason Fulghum 68a771bbca Tidying up 2023-10-05 16:05:42 -07:00
Jason Fulghum b25a6555d3 Fixes for inmemfs implementation of MoveDir 2023-10-05 14:09:11 -07:00
Jason Fulghum 0570288de0 Tidying up 2023-10-04 10:18:53 -07:00
Jason Fulghum 93b044f233 Various small fixes 2023-10-03 15:58:00 -07:00
Jason Fulghum 1cb66beede Bug fixes for inmemfs MoveDir implementation 2023-10-03 14:11:44 -07:00
Jason Fulghum c813142a6d First pass at implementation and tests for MoveDir method in InMemFS 2023-10-03 13:20:58 -07:00
Jason Fulghum 7ac5799066 First pass on support for dolt_undrop() stored procedure to "undrop" a database after it has been dropped. 2023-10-02 18:32:53 -07:00
Stephanie You cdfabd2876 PR feedback 2023-08-29 14:35:24 -07:00
Stephanie You 392581fc8f make NO_POSITIONAL_ARGS a constant 2023-08-25 16:25:51 -07:00
Stephanie You 735837fc3a update dolt log to support tables separator (--) 2023-08-23 10:53:59 -07:00
Jason Fulghum 5514c1dce3 Fix for https://github.com/dolthub/dolt/issues/6001 2023-07-20 15:19:28 -07:00
Zach Musgrave 4f8f25312f Merge branch 'main' into ioutil 2023-06-28 14:37:20 -07:00
guoguangwu a84e257645 chore: remove refs to deprecated io/ioutil 2023-06-26 14:39:28 +08:00
Neil Macneale IV f32fc4699a PR Feedack addressed 2023-06-23 09:51:52 -07:00
Neil Macneale IV cd0cf8f9a4 Add ability to drop values from ArgParserResults 2023-06-16 15:56:11 -07:00
Nick Tobey 72f0dc2bad Add clarifying comment to ParseGlobalArgs 2023-05-23 12:28:53 -07:00
Nick Tobey a1b2a38f47 Use more meaningful variable names. 2023-05-23 12:21:19 -07:00
Nick Tobey edc5528ace Replace global arg parser. 2023-05-22 16:13:11 -07:00
Neil Macneale IV 9575228ae5 Refactor SQLEngine instantiation into the Queryist interface
SQL Command arguments which pertain to instantiating a local SqlEngine instance are now global arguments which come before the sql subcommand. This is a breaking change for users of the sql command who pass in the following arguments:

--data-dir
--user
--doltcfg-dir
--privilege-file
--branch-control-file
All of the test changes pertain to moving those arguments, and nothing else. This is by design to ensure we don't have broader impact to the interface.

With this abstraction in place, we can put a different Queryist implementation in place - specifically one which talks to a remotes server - which is the end goal.

See: https://github.com/dolthub/dolt/issues/3922
2023-05-08 16:50:46 -07:00
James Cor 6d664a5963 deleted wrong tests 2023-05-05 14:24:15 -07:00
James Cor 9120ab1ad3 better fix 2023-05-05 14:06:32 -07:00
James Cor e2fdc9d16d fix unit tests 2023-05-05 12:21:50 -07:00
James Cor b98a8949ee normalize windows file paths better 2023-05-05 12:08:05 -07:00
Neil Macneale IV 2dd8ad68f9 Update Go tests to use CliContext with an SqlEngine 2023-05-05 11:46:47 -07:00
Nick Tobey fe47616684 Add unit test for too many arguments passed to ArgParser. 2023-04-19 11:37:36 -07:00
Nick Tobey 43aee5f4d1 Update Name field in ArgParser. 2023-04-19 11:37:18 -07:00
Nick Tobey f86c44db47 Add docstrings for NewArgParser... functions. 2023-04-19 11:36:48 -07:00
Nick Tobey ebcaabc5b4 Rename ArgParser.TooManyArgsError to TooManyArgsErrorFunc 2023-04-19 11:36:18 -07:00
Nick Tobey c0a8cb33d2 Fix typo in parser.go error string. 2023-04-18 11:49:35 -07:00
Nick Tobey 19ef9a1d21 ArgParser now takes the name of the command being parsed.
This allows us to print the command name in error messages and disambiguate cases where `dolt_sql` calls a procedure that corresponds to another dolt command.
2023-04-18 11:45:58 -07:00
Nick Tobey 6b2bec33b3 Allow any number of arguments when MaxArgs is set to -1. 2023-04-14 15:23:54 -07:00