Rafa de la Torre
064cc2a76b
Fix for missing port in pg_foreign_server: default to standard 5432
2019-11-14 17:57:05 +01:00
Rafa de la Torre
7f9905cbd5
Test what happens when missing PG port
2019-11-14 17:56:29 +01:00
Rafa de la Torre
9b91704480
Calculate stats only when they make sense
2019-11-13 19:27:56 +01:00
Rafa de la Torre
a340f98b96
Update tests with latency stats
2019-11-13 19:19:39 +01:00
Rafa de la Torre
57dcfc2a35
Add a bunch of statistics
2019-11-13 18:55:09 +01:00
Rafa de la Torre
3ae7b1fe05
Fix bug: do not initialize samples in every iter
2019-11-13 18:27:14 +01:00
Rafa de la Torre
f7d10adbc2
Fix another python2/3 incompat: xrange
2019-11-13 17:16:53 +01:00
Rafa de la Torre
203bd64058
Fix python2/3 compat issue
2019-11-13 17:02:22 +01:00
Rafa de la Torre
19c6de2096
Comment out suspected line
...
This may be causing the error
ERROR: could not compile PL/Python function "__cdb_fs_tcp_foreign_server_latency"
DETAIL: SyntaxError: invalid syntax (<string>, line 26)
when testing in PG12 + plpythonu3
2019-11-13 14:52:24 +01:00
Rafa de la Torre
4b9c048235
Close socket properly before the next iteration
...
This avoid the errors `[Errno 106] Transport endpoint is already
connected` which are due to connections kept in TIME_WAIT state.
We don't use socket.SO_REUSEADDR as it would make the first connection
a special case compared to the following ones.
2019-11-13 12:25:41 +01:00
Rafa de la Torre
5897d8a9cb
Fix timer start in measurements
2019-11-13 12:24:59 +01:00
Rafa de la Torre
980657c4a4
Do not add None to samples in case of connection error
...
Otherwise we get `TypeError: unsupported operand type(s) for +: 'float'
and 'NoneType'` when calculating the average.
2019-11-13 12:16:21 +01:00
Rafa de la Torre
a4a4a1dff1
Honor n_samples param
2019-11-13 12:13:42 +01:00
Rafa de la Torre
0362825b8c
Encapsulate python in __CDB_FS_TCP_Foreign_Server_Latency
...
Instead of having a generic function, merge
__CDB_FS_TCP_Network_Latency and __CDB_FS_Foreign_Server_Host_PG into
one function so that it can only "ping" federated servers.
2019-11-13 11:44:24 +01:00
Rafa de la Torre
364933b6b9
Compatibility with PG 9.6 and 10
...
See https://www.postgresql.org/message-id/flat/55137679-fd6b-baf0-bfbf-6558ce5cb409%40postgrespro.ru
2019-11-12 15:57:15 +01:00
Rafa de la Torre
18f9f79fe8
Rename key to server_latency_ms to be self-explanatory
2019-11-12 15:08:26 +01:00
Rafa de la Torre
a032cc08e0
Measure latency as the avg of n_samples
2019-11-12 15:01:56 +01:00
Rafa de la Torre
9dc547c838
Add test for wrong port
2019-11-12 13:37:04 +01:00
Rafa de la Torre
d3ae4b808c
Remove default port 5432 in generic function
2019-11-12 13:27:42 +01:00
Rafa de la Torre
26f91001ee
Retrieve port from the catalog
2019-11-12 13:06:14 +01:00
Rafa de la Torre
43b242e610
Retrieve host from the catalog
2019-11-12 13:02:04 +01:00
Rafa de la Torre
e14c49b223
Add kind of meaningful test for latency
2019-11-12 12:59:36 +01:00
Rafa de la Torre
8c7a75dd0c
Implement __CDB_FS_TCP_Network_Latency
2019-11-12 12:42:28 +01:00
Rafa de la Torre
dbed2d1ede
More scaffolding for latency in diagnostics
2019-11-12 12:41:37 +01:00
Rafa de la Torre
1c27443ff4
Stub remote server latency (WIP)
2019-11-12 12:41:37 +01:00
Rafa de la Torre
944b111bb1
Merge pull request #383 from CartoDB/federated_diagnostics
...
Retrieve target PG and postgis versions
2019-11-12 10:45:26 +01:00
Rafa de la Torre
d5ecb39250
Replace hardcoded 5432 by @@PGPORT@@
...
as requested in review comment
2019-11-12 10:32:25 +01:00
Rafa de la Torre
0ad7cd485d
Simplify function with aggregate
2019-11-11 21:34:51 +01:00
Rafa de la Torre
6e9ee296c5
Remove useless commented code
2019-11-11 20:48:14 +01:00
Rafa de la Torre
d87d27d7e5
Use pg_options_to_table instead of manual parsing
2019-11-11 20:42:00 +01:00
Rafa de la Torre
5c9f6964a3
Fix typo: hardcoded loopback server
2019-11-11 18:46:07 +01:00
Rafa de la Torre
d76e3ccc3e
Add server options to diagnostics
2019-11-11 16:02:04 +01:00
Rafa de la Torre
eba6cf4565
Test when postgis is not installed in the remote
2019-11-08 20:27:24 +01:00
Rafa de la Torre
6700d24232
Refactor: extract __CDB_FS_Import_If_Not_Exists
2019-11-08 20:16:26 +01:00
Rafa de la Torre
511e24a40e
Remove unused var role_name
2019-11-08 20:05:08 +01:00
Rafa de la Torre
80f01d4a51
Implement retrieval of remote postgis version
2019-11-08 20:02:51 +01:00
Rafa de la Torre
d4bc69cd3c
Return postgis version in diagnostics info (WIP)
2019-11-08 19:49:16 +01:00
Rafa de la Torre
8730292097
Function to retrieve remote PG server ver
2019-11-08 19:20:08 +01:00
Rafa de la Torre
efd757ffa3
Check against correct server version
2019-11-08 18:18:28 +01:00
Rafa de la Torre
40a2ba9569
Stub function to add server_version to diagnostics
2019-11-08 18:09:22 +01:00
Rafa de la Torre
35b2b7e589
Check the server is of type PG and return jsonb
2019-11-08 18:06:35 +01:00
Rafa de la Torre
4100b66f3b
Scaffolding for diagnostic function(s)
2019-11-08 17:11:04 +01:00
Raul Marin
d5b3953568
Regress: Remove output that depends on PROJ release
2019-11-06 18:34:20 +01:00
Raul Marin
c64c61781e
Make tests path insensitive
2019-11-06 18:26:58 +01:00
Raul Marin
82d8f7e1aa
Deprecate FDW user setup ;__(
2019-11-06 18:26:37 +01:00
Raul Marin
3cde55ed3a
Enforce output order in CDB_Federated_Server_List_Remote_Columns
2019-11-06 17:32:48 +01:00
Raul Marin
a91f14371a
Use always the modern notation for named parameters
2019-11-06 17:25:10 +01:00
Raul Marin
899a12fc53
FederatedServer: Use NAME for internal types
2019-11-06 17:12:40 +01:00
Raul Marin
01258530ff
Federated Server: Unify remote table listing
...
- Removes DB_Federated_Server_List_Registered_Tables in favor
of CDB_Federated_Server_List_Remote_Tables that now returns
both registered and unregistered tables and, when they are
registered, the information about the associated view
2019-11-06 17:04:11 +01:00
Raul Marin
90b58fcdec
Federated Server: Test with incorrect password
2019-11-06 10:20:53 +01:00