Граф коммитов

611 Коммитов

Автор SHA1 Сообщение Дата
Alain Jobart d43aa489a6 Changing python client bind variable style from pyformat to named.
It's what we do in other clients, and what Vitess expects.
Still keeping the conversion function in case someone is interested.
2016-03-03 12:19:59 -08:00
Alain Jobart f9d7786977 Factoring out some common code in proto3 python client. 2016-03-03 12:19:59 -08:00
Alain Jobart 9a3d527bdc Common function from proto3_encoding in grpc update stream client. 2016-02-29 09:26:52 -08:00
Alain Jobart 39ac3e9721 Splitting up the grpc vtgate python client into two parts:
- a reusable proto3 encoding / decoding class.
- the core gRPC code (includes query routing and error handling).

That way it's trivial to use proto3 on any other transport.
2016-02-29 09:26:52 -08:00
Anthony Yeh 938f31743d Update to gRPC 0.13. 2016-02-27 02:31:03 -08:00
Dean Yasuda 3baca38fbe Change param order of vtgate cursor init. 2016-02-10 10:12:50 -08:00
Dean Yasuda a65c612c42 Change grpc_vtgate_client execute param order. 2016-02-09 21:32:51 -08:00
Dean Yasuda a013182fbd Make py client tablet_type precede keyspace_name.
In vtgatev2._execute and _stream_execute, make
tablet_type precede keyspace_name, since vtgate v3 will
not pass keyspace_name.

Make vtgate_cursor and test calls to py client _execute
use keyword args so that order does not matter.
2016-02-09 21:27:15 -08:00
dumbunny 03697a7fd6 Merge branch 'master' into v2v3 2016-02-08 14:58:05 -08:00
Dean Yasuda 9b240ee888 Revert sql_builder.TupleCompare to use AND/ORs.
The MySQL optimizer does always find good indexes for:

   ('x', 'y') < (3, 4).

Therefore, while keeping the name TupleCompare, I am reverting
the SQL back to:

  x = 3 AND y < 4 OR x < 3.
2016-02-08 13:59:40 -08:00
thompsonja 914900ce1e Merge branch 'master' into use_mysql_socket 2016-02-07 12:57:53 -08:00
Joshua Thompson c37fc9ad86 Update test code to use unix socket instead of tcp connection if available 2016-02-07 12:10:10 -08:00
Alain Jobart aeda5a0f04 Removing a couple uses of vtgatev2.py gorpc python client.
And a couple more details.
2016-02-04 08:12:40 -08:00
Dean Yasuda af7ceff0b8 Update sql_builder.AfterPrevValues.
Use tuple-comparison instead of complex boolean expression. Add
helper classes TupleGreater, TupleGreaterEqual, TupleLess, TupleLessEqual.
2016-02-03 14:47:08 -08:00
Michael Berlin 5399771ba3 Merge pull request #1475 from michael-berlin/wait_for_drain
Add vtctl WaitForDrain command.
2016-02-02 17:32:37 -08:00
Alain Jobart a200745b6c Fixign a few minor things in this file. 2016-02-02 11:29:09 -08:00
Alain Jobart 1875db7907 Adding {,Stream}ExecuteShards support to python client.
Also re-ordering code so the order is always:
shards, keyspace_ids, keyranges, entity_ids, then v3.
2016-02-02 07:35:23 -08:00
Michael Berlin 203649e33d vttablet: Added "qps" field to healthcheck message.
This required exposing QueryEngine's QueryServiceStats instance in the tabletserver.Controller interface.
2016-02-01 17:10:46 -08:00
Alain Jobart 639c000b2c Adding echo tests to the python client tests.
Also adding retries to grpc client.
2016-02-01 09:32:02 -08:00
Alain Jobart 5e239b6198 Fixing a few things from comments. 2016-02-01 07:14:33 -08:00
Alain Jobart e2a14d9390 Renaming xid_{type,value} to {type,value} in the proto3
entity id. Should be safe.
2016-01-29 14:19:14 -08:00
Alain Jobart 9b9a3d77d0 Simplifying tests, some easy refactor. 2016-01-28 17:16:41 -08:00
Alain Jobart 4f4b7e9fe3 Fixing a few more things, vtgatev2_test now passes. 2016-01-28 10:04:22 -08:00
Alain Jobart 5814326359 Fixing a couple things to vtgatev3 passes with gRPC. 2016-01-28 08:20:10 -08:00
Alain Jobart efdf2a9d18 Checkpoint of new grpc python client.
It passes python_client_test so far, not more.
Stuck on the batch API for now, not sure we need the dual-API.
2016-01-28 07:11:33 -08:00
Ammar Aijazi 3e39a12b46 Pass kwargs through from the VtGate cursor to the VtGateConnection 2016-01-16 07:54:17 -08:00
Alain Jobart a4f7936c23 Adding vtctl RPC interface to vtcombo, with unit test. 2015-12-14 08:02:41 -08:00
Alain Jobart f46bd25d3e Adding vtctld functionnality to vtcombo. 2015-12-10 06:56:36 -08:00
Alain Jobart 4aa792733b Removing KeyspaceIdType from StreamKeyRange queries.
Effect is far-reaching to tabletmanager, which doesn't need to
read KeyspaceInfo any more. Cool!
2015-12-04 15:51:24 -08:00
Alain Jobart d8c0e7797d Removing the 'want_fields' flag for tm.ExecuteFetchAs*.
Defaulting it to true. Not worth the hassle.
2015-12-02 10:56:46 -08:00
Dean Yasuda 7ae3f86064 Comment PEP 0249 globals in py/vtdb/__init__.py. 2015-12-01 10:44:29 -08:00
Dean Yasuda b2fb7b6e64 Remove rest of py/vtdb/__init__.py.
Register 'gorpc' vtgate_client in test/utils.py rather than py/vtdb/__init__.py.
2015-11-30 14:41:03 -08:00
Dean Yasuda b4b780ec82 Remove py/vtctl/__init__.py.
py/vtctl/gorpc_vtctl_client.py now registers the 'gorpc' vtctl_client.

Import gorpc_vtctl_client.py to test/utils.py.
2015-11-30 11:30:29 -08:00
Dean Yasuda fd34da247b Merge branch 'master' into v2v3 2015-11-24 15:41:42 -08:00
Dean Yasuda e7bcd0480a Provide more v3 exception details. 2015-11-24 15:40:06 -08:00
Alain Jobart 6389f7bc2e Retiring logutil.LoggerEvent in favor of logutilpb.Event. 2015-11-16 08:08:18 -08:00
Dean Yasuda b7566a4109 Merge branch 'master' into v2v3 2015-11-11 15:15:23 -08:00
Dean Yasuda 3e10eec9e2 Merge vtgatev3 into vtgatev2.
* vtgatev2 will later be named vtgate_gorpc_client.
  * Pass more info to converted exceptions.
  * Clean up lint errors.
2015-11-11 15:13:23 -08:00
Anthony Yeh 06124495b4 Stop looking for mysql.host table.
The mysql.host table has been obsolete since at least MySQL 5.0:

https://dev.mysql.com/doc/refman/5.0/en/grant-table-structure.html

In recent versions, the table is no longer created for new
installations.
2015-11-10 11:41:30 -08:00
Anthony Yeh b89d988e30 Make MySQL users and privileges configurable.
This gets rid of the opaque mysql-db-dir.tbz archive, replacing it with
a .sql file. The .sql file approach makes it clear what state the DB is
initialized with, and also makes it easy to customize.
2015-11-10 11:41:24 -08:00
Alain Jobart 6751c65693 Using enumerate() in a few places where it's appropriate.
Thanks @aaijazi for the suggestion.
2015-11-09 14:23:14 -08:00
Alain Jobart b940f5278f Removing native StreamEvent, replacing it with proto3 version. 2015-11-09 09:23:29 -08:00
Alain Jobart f41a173e2d Fixing a couple details:
- grpc_vtctl_client still had deprecated lock_timeout.
- adding a test for vtctld dying on startup.
- fixing a few lint errors.
2015-11-05 09:18:53 -08:00
Alain Jobart 51be389106 Submitting changes that were already made internally. 2015-11-05 07:33:02 -08:00
Alain Jobart c7fb1dcb3c Merge pull request #1282 from alainjobart/resharding
go Session is no more, proto3 version is used now.
2015-11-05 07:08:03 -08:00
Dean Yasuda 4127f5bf41 Clean up pylint errors in 2 simple modules. 2015-11-04 19:57:06 -08:00
Dean Yasuda ca109103dd Make pylint pre-commit hook less strict.
Ignore some google-specific warnings that don't apply.

When displaying errors, print path name on each error line instead of as
a header.

Clean up a couple of python files modified while testing.
2015-11-04 19:47:34 -08:00
Alain Jobart 70df81eb83 Using proto3 TabletType in bson vtgate queries. Last use of the non-proto3
tablet type.
2015-11-04 13:38:30 -08:00
Alain Jobart 703121eb8f Removing locktimeout from vtctl protocol. 2015-11-03 11:20:12 -08:00
Dean Yasuda 8244a64166 Apply pylint to a couple more files.
This uses the new pylint pre-commit hook.
2015-11-02 16:45:37 -08:00
Dean Yasuda 9ebb500e6d Add pylint pre-commit hook.
This uses /usr/bin/gpylint; systems without gpylint will
skip this check.
2015-11-02 15:51:39 -08:00
dumbunny 5895f58345 Merge pull request #1259 from dumbunny/entity_ids
Clean up vtgatev2.py after merging entity_ids in.
2015-10-28 17:34:05 -07:00
Dean Yasuda 8b5fa5e77b Fix vtgatev2._execute logic.
vtgatev2._execute should use entity_keyspace_id_map if provided,
overriding keyspace_ids / keyranges.

Fix pylint errors.
2015-10-28 15:00:24 -07:00
Dean Yasuda a9f427d6fa Add sql_builder.NotLike where expr. 2015-10-28 11:59:37 -07:00
Anthony Yeh 0e602ee49a Merge branch 'master' into proto 2015-10-27 21:40:29 -07:00
Sugu Sougoumarane d12476e9fe proto: migrate EntityIds 2015-10-25 22:02:58 -07:00
Sugu Sougoumarane 5aa0b5c830 proto: add error handling 2015-10-24 18:10:03 -07:00
Sugu Sougoumarane 94eb00ff00 proto: misc renames
Float -> Float32
Double -> Float64
IsNumber -> IsIntegral

Also addressed some code review comments.
2015-10-24 00:08:53 -07:00
Sugu Sougoumarane c5691e1cbc proto: revamp bind vars
I've done enough to get the existing unit tests to pass, but I
think they're insufficient. There also a few TODOs sprayed around.
2015-10-23 22:30:35 -07:00
Dean Yasuda c079f66739 Merge branch 'master' into entity_ids 2015-10-23 17:24:04 -07:00
Sugu Sougoumarane 6ed05d1d28 proto: int type names changed
Tiny, Long, etc. are not very understandable. I've now changed the
types to intXX, which is more intuitive.
2015-10-23 13:46:47 -07:00
Alain Jobart 477c948cc2 Using topo proto3 in tests to get tablet types. 2015-10-23 07:12:49 -07:00
Alain Jobart cff02b5c10 Removing SCHEMA_UPDATE tablet type, unusued. Re-ordering existing
types in proto3.
2015-10-23 07:12:49 -07:00
Alain Jobart 73497d2a16 Checkpoint of removing IDLE and SCRAP states. All unit tests pass,
most integration tests pass too.
2015-10-23 07:12:49 -07:00
Sugu Sougoumarane c7918063a3 New rows proto change
So far, unit tests are passing. Still need to look at clients.
2015-10-23 02:07:03 -07:00
Sugu Sougoumarane ba7921e963 changed proto enums to idiomatic upper case 2015-10-22 22:51:53 -07:00
Sugu Sougoumarane 175fcf2acc New vitess-specific types
This change defines the new types, how they are derived from
MySQL, and tests to make sure the conversions work.
2015-10-22 22:17:35 -07:00
Dean Yasuda 2fbbec7995 Merge execute_entity_ids into execute.
This merges the functions in py/vtdb/{vtgate_cursor,vtgatev2}.py.
2015-10-22 06:34:33 -07:00
Michael Berlin 8592cf7179 Only consider *.sql files when applying schema. Fail if the schema directory for a keyspace does not exist.
NOTE: Changes were already LGTM'd internally.
2015-10-20 16:50:25 -07:00
Michael Berlin 5d28adf165 Revert "Only consider *.sql files when applying schema." 2015-10-20 15:54:42 -07:00
Dominic Hamon 1be23db75f Back to exception and add more information. 2015-10-20 12:28:14 -07:00
Dominic Hamon 4ab1c1d5db Replace exception with logging.warn 2015-10-20 12:08:13 -07:00
Dominic Hamon 5deec2e205 add missing import 2015-10-20 09:53:58 -07:00
Dominic Hamon c1cbcf81d1 Only consider *.sql files when applying schema.
Also add more checks and clearer error messages.
2015-10-20 09:40:13 -07:00
Michael Berlin f625a3104e Exporting internal changes back to open-source.
NOTE: Changes were already LGTM'd internally.
2015-10-19 13:43:30 -07:00
sougou 896bc75519 Merge pull request #1211 from youtube/suguwork
v3 demo: is now self-contained
2015-10-14 12:30:19 -07:00
Sugu Sougoumarane cc20205dcc vttest, v3 demo: make vschema explicit 2015-10-14 11:54:38 -07:00
Sugu Sougoumarane e91a995c47 vttest: handle empty schema_dir case 2015-10-13 21:40:20 -07:00
Sugu Sougoumarane 573f9f62b2 v3 demo: is now self-contained
It's been changed to use vttest, and there is a script
that brings up everything, and tears down at the end.
The one problem with the new scheme is that the querylog
doesn't tell you which tablet the query came frome. Something
to think about in the future.
2015-10-13 21:30:27 -07:00
Ammar Aijazi 14756961f3 Merge pull request #1203 from aaijazi/aaijazi_add_warning_to_vtdb_logger
Add a warning method to vtdb.VtdbLogger...
2015-10-13 15:47:10 -07:00
Alain Jobart e07bf3763d One extra function that needed to go in there. 2015-10-13 07:55:39 -07:00
Alain Jobart d379eab458 Removing two unused modules, and fixing setup.py. 2015-10-13 07:52:34 -07:00
Alain Jobart 87693af4c7 Removing direct tablet access from python.
One hack left in vtrouting.py, and then topology.py can go too.
Dean, I'll let you handle that one.
2015-10-13 07:41:58 -07:00
Alain Jobart 9aaa24c5a0 Removing the object python library, as we decided it's too much
for us to maintain.
2015-10-13 07:06:33 -07:00
Ammar Aijazi 128661b305 Update vtdb_logger.py
Add kwargs to VtdbLogger.warning()
2015-10-12 21:57:10 -07:00
Ammar Aijazi fd09c20172 Add a warning method to vtdb.VtdbLogger, so that we can swap it out for different implementations 2015-10-12 17:04:31 -07:00
Alain Jobart 5d0b747661 Adding the 'serving' flag to StreamHealthCheck. 2015-10-12 12:05:43 -07:00
Dean Yasuda 822175a40c Make sure vtgatev2.VTGateConnection is registered. 2015-10-10 15:35:38 -07:00
Dean Yasuda 86efe6ee93 Clean up py/vtdb/__init__.py. 2015-10-10 10:42:53 -07:00
Alain Jobart c144bba292 Adding a unit test of the vttest setup in vttest_sample_test.py.
This requires using the protocol from flavors.
Also using ValueError exception instead of plain Exception
in vtgate_client.py.
2015-10-09 13:47:41 -07:00
Alain Jobart d3dcddee15 Merge pull request #1191 from alainjobart/resharding
Not supporting vtocc+vtgate in vttest, only vtcombo.
2015-10-08 14:52:53 -07:00
Anthony Yeh e884b9111a Merge pull request #1190 from enisoc/php-grpc
Add gRPC PHP dependencies to Travis/Docker
2015-10-08 11:59:08 -07:00
Anthony Yeh 7e32cdadf8 vttest: Fix MySQL56 cnf file path. 2015-10-08 11:50:11 -07:00
Alain Jobart bc758cb661 Moving queryserver parameters to their own list. That way
if anyone else wants to re-use them in a test env they can.
2015-10-08 07:34:18 -07:00
Alain Jobart ffa5c9bd26 Removing vtocc+vtgate support in vttest, now only does vtcombo. 2015-10-08 07:31:09 -07:00
Alain Jobart 4f96301df1 Adding longer timeouts for unit tests. 2015-10-07 20:26:55 -07:00
Alain Jobart c1d146b300 Increasing timeout value. 2015-10-05 19:23:45 -07:00
Alain Jobart 602da2700a Using terminate() instead of kill() in vttest to get logs flushed. 2015-10-05 17:54:04 -07:00
Alain Jobart b46ce0c631 Lowering resources for test vtcombo. 2015-10-05 08:48:12 -07:00
Alain Jobart d9066317c1 Removing cbson. We'll remove bson support eventually. 2015-10-01 07:29:09 -07:00