Change the vtgateclienttest/services/callerid.go test to always return
an error when callerid is handled. The error will contain word
"SUCCESS:" if callerid matches. This is necessary since falling through
breaks the expectations of the caller.
In the connection's _execute_batch call, some routing will be
keyspace_ids, and some will be by shards. This means that an
_execute_batch may create both a ExecuteBatchKeyspaceIds and
ExecuteBatchShard call. Merge the results back together.
Add tests for ExecuteBatchShard in python_client_test.py and
vtgatev2_test.py.
Since BatchVTGateCursor only adds executemany and nextset functionality,
just add that functionality to vtgate_cursor.VTGateCursor. Fix tests and
code that refers to BatchVTGateCursor.
To comply with PEP0249, remove the BatchVTGateCursor execute and flush
sequence and use executemany instead. The first argument to executemany
is sql if all commands share a common sql (this is supposed to be an
"operation" parameter). The params_list will supply sql if the first
argument is None.
Each params in the executeany params_list generates a result set.
Implement the nextset() to walk through the result_set.
Update tests to use the new BatchVTGateCursor API.
Always open a new connection for every stream_execute. Reusing an
existing connection may cause problems if you are in a transaction; this
logic is simpler.
Also, change the cursor._get_conn() method into a cursor.connection property.
Only cursor.set_effective_caller_id(effective_caller_id) is now
supported. Sending effective_caller_id as an argument to PEP0249
functions will fail or be ignored.
In base cursor classes, Make set_effective_caller_id a separate call
rather than passing effective_caller_id through interfaces (cleanup to
come later).
Remove some try-except log-and-raise wrappers in vtgatev2 test methods.
The default logging, and put the logging in get_connection instead.
Vtgate connection stream_execute now detaches the BsonRPCClient from the
connection and closes it after the generator exits. The connection will
quietly open a new BsonRPCClient if another execute is called.
Move some common code into base_cursor.py.
Make the third_party StreamCursor._stream_execute return generators and
migrate stage variables out of the vitess clients.
Remove class variables that shadow object variables. These are a
potential source of hard-to-find bugs. Move initial values into object
__init__ methods instead.
This is the first pass for some subdirectories.
Recurring issues include:
1. Inconsistent quote chars. Use the same quote character as the first
use in the file (usually single-quote). Double quotes are OK if the
quoted string contains single quotes.
2. Bad indentation. Indent 2 for logic, 4 for continuations if the
previous line ends with '(', '[', or '{'. If drop does not immediately
follow the group-symbol, align with the opening group-symbol. I suggest
immediate drops, since these are stable if the content of the first
line changes, while aligning with the opening group-symbol requires
shifting the continuation lines.
3. Bad docstrings. A full docstring looks like:
"""Initial line ending with punctuation.
Optional text.
Args:
Arg1: Description.
Arg2: Description with
indented continuation.
Returns:
Return text.
Raises:
ErrorClass: Description.
"""
4. Vertical spacing. Exactly two blank lines before top-level classes
or functions. Exactly one blank line before non-top-level classes or
functions. No more than one blank line within top-level constructs.
The rename makes it clear that this is to OR non-trivial statements
for a single column together, not a general purpose OR, and not to
be used when a simple IN statement could be used.
AfterPrevValues is used for multi-dimensional, ordered traversal after
a continuation point.
1. Stop using youtube specific name as caller id.
2. Set caller id as TabletConnection field and use it in the remaining methods.
3. Delete _stream_execute2 in tablet.py since it is now identical to _stream_execute.
1. Call SqlQuery.Execute*2 in py/vtdb/tablet.py.
2. Add default caller id: youtube-dev-dedicated for each rpc call.
3. Set proper table ACL in test/test_data/table_acl_config.json.
We're only interested in the fact that the receiving master has seen a lower delay at some point in time. We don't care about the actual timestamps of the filtered replication statements which were applied.
The previous python client API bound the batch cursor
to a single keyspace_id list, which is not practical
for batch commands. This change removes that binding,
and instead lets you specify the keyspace and keyspace_ids
for each query.
The python clients and their tests are now functional as before,
but they need to be improved. They still have the inflexibility
where you can specify only one keyspace id list for an entire
batch, rather than one list per query.
- vtgate doesn't listen to socket_file any more.
- removing bsonrpc python client socket_file support.
The plan is to change mysqlctl to gRPC by changing from bsonrpc to
gRPC when listening to socket file.
Updating protobuf to v3.0.0-alpha-2 (to match gRPC's version)
Now the python vtctl client works as expected (!!!).
Also splitting up go and python vtctl client implementations
(will be used inside google3).
cannot have the same <package name>.<data type> as these, or we cannot
load them at the same time. So to fix this:
- renaming the conflicting ones from xxx.proto to xxxdata.proto.
- renaming vtgateservice.VTGate to vtgateservice.Vitess
Note we can still change the names I chose here, just not back to
conflicting ones. If anyone has better ideas, we can implement
in subsequent changes. This is to get the import to google3 unstuck.