google / trillian

A transparent, highly scalable and cryptographically verifiable data store.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TrillianAdmin.ListTrees does not work on cloudspanner

mhutchinson opened this issue · comments

The query that backs this method does "SELECT ... FROM TreeRootsByDeleted". On CloudSpanner one cannot simply select from an index. This causes a failure with message "Table not found: TreeRootsByDeleted".

Running the query "SELECT ... FROM TreeRoots@{FORCE_INDEX=TreeRootsByDeleted}" does work in CloudSpanner, but this needs testing to ensure the performance is as expected.

I also noticed that admin.go has a ListTreeIDs method which does not appear to be on the RPC interface. Should this be wired up, or cleaned up?

Testing on latest build, I now get:

File "main.py", line 181, in listTrees    response = stub.ListTrees(trillian_admin_api_pb2.ListTreesRequest(show_deleted=undeleted))  File "/Users/paulmattei/code/python-trillian/venv/lib/python3.7/site-packages/grpc/_channel.py", line 550, in __call__    return _end_unary_response_blocking(state, call, False, None)  File "/Users/paulmattei/code/python-trillian/venv/lib/python3.7/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking    raise _Rendezvous(state, None, None, deadline)grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with: status = StatusCode.UNKNOWN details = "spanner: code = "InvalidArgument", desc = "failed to decode column 0, type *spannerpb.TreeInfo cannot be used for decoding BYTES"" debug_error_string = "{"created":"@1554084142.837290000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1036,"grpc_message":"spanner: code = "InvalidArgument", desc = "failed to decode column 0, type *spannerpb.TreeInfo cannot be used for decoding BYTES"","grpc_status":2}"

createTrees now working correctly. Now found as issue with deleteTree - is this connected or shall I raise a new issue?

https://github.com/paulmattei/trillian/blob/054c807a670eee7a2e0e612d2db425ac8cf5be3f/examples/python/main.py

Traceback (most recent call last): File "main.py", line 20, in <module> trillian.deleteTree(my_first_tree) File "/Users/paulmattei/code/trillian/examples/python/trillian.py", line 73, in deleteTree tree_id=tree.tree_id)) File "/Users/paulmattei/code/python-trillian/venv/lib/python3.7/site-packages/grpc/_channel.py", line 550, in __call__ return _end_unary_response_blocking(state, call, False, None) File "/Users/paulmattei/code/python-trillian/venv/lib/python3.7/site-packages/grpc/_channel.py", line 467, in _end_unary_response_blocking raise _Rendezvous(state, None, None, deadline) grpc._channel._Rendezvous: <_Rendezvous of RPC that terminated with: status = StatusCode.UNKNOWN details = "spanner: code = "InvalidArgument", desc = "client doesn't support type spannerpb.TreeState"" debug_error_string = "{"created":"@1554252977.238832000","description":"Error received from peer","file":"src/core/lib/surface/call.cc","file_line":1036,"grpc_message":"spanner: code = "InvalidArgument", desc = "client doesn't support type spannerpb.TreeState"","grpc_status":2}"

Cheers Paul. I'll do a full review of the cloudspanner admin API today. This is turning into a game of whack-a-mole.

#1490 <- this works when integrated. If you build from head right now though you'll hit another problem which requires #1491 to work around.