Add workload routing connection property#508
Conversation
| b'binary_data_protocol': '1' if binary_transfer else '0', # Defaults to text format '0' | ||
| b'protocol_features': '{"request_complex_types":' + request_complex_types + '}', | ||
| b'protocol_compat': 'VER', | ||
| b'workload': workload, |
There was a problem hiding this comment.
Does this need protocol version increase?
Your test calls self.require_protocol_at_least(3 << 16 | 15), but the request version in vertica_python/__init__.py is still 3.14.
There was a problem hiding this comment.
Actually since we are just querying the dc client server messages table it won't require a protocol version increase. I'll remove this
There was a problem hiding this comment.
Please don't remove require_protocol_at_least(). Querying the dc client server messages table need to have server greater than a certain version, so that dc_client_server_messages table is defined.
There was a problem hiding this comment.
This also requires "SHOW WORKLOAD" which I've implemented on the server in version 23.3. This test can't pass until we have a Vertica image available for 23.3 which is not yet released so it will be a while.
| elif key in ('connection_load_balance', 'use_prepared_statements', | ||
| 'disable_copy_local', 'ssl', 'autocommit', | ||
| 'binary_transfer', 'request_complex_types'): | ||
| 'binary_transfer', 'request_complex_types', 'workload'): |
There was a problem hiding this comment.
This is for boolean type parameters. Parameter 'workload' accepts and passes a string to the server. So no need to add it at here.
|
|
||
| def test_workload_default(self): | ||
| with self._connect() as conn: | ||
| self.require_protocol_at_least(3 << 16 | 15) |
There was a problem hiding this comment.
This require_protocol_at_least() should be moved to the top of the test function.
| query = """SELECT contents FROM dc_client_server_messages | ||
| WHERE session_id = current_session() " + | ||
| AND message_type = '^+' " + | ||
| AND contents LIKE '%workload%'");""" |
There was a problem hiding this comment.
Syntax error in this multiline string
There was a problem hiding this comment.
ah yes, came from copying and pasting a concatenated string
| AND message_type = '^+' " + | ||
| AND contents LIKE '%workload%'");""" | ||
| res = self._query_and_fetchone(query) | ||
| self.assertEqual(res[0], 'python_test_workload') |
There was a problem hiding this comment.
The result should be equal to 'workload: python_test_workload', rather than 'python_test_workload'.
bd855fe to
e621fb6
Compare
Adding workload routing connection property which will be available in Vertica 23.3 release.