You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cassandra.apache.org by "maxwellguo (Jira)" <ji...@apache.org> on 2020/06/15 02:45:00 UTC
[jira] [Commented] (CASSANDRA-15871) Cassandra driver first
connection get the user's own schema information
[ https://issues.apache.org/jira/browse/CASSANDRA-15871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17135346#comment-17135346 ]
maxwellguo commented on CASSANDRA-15871:
----------------------------------------
Hi [~brandon.williams],when using a driver to do some operaions on cassandra , different users can get all the schemas information when first made a connection after the Auth setp.
User A, may store all the keyspaces/tables information in the client side, That's beacuse the client doing query like : "SELECT * FROM System_schema.keyspaces" and get all keyspace from system_schema table。But some keyspace or tables or type may not be created by UserA, It may be UserB;
for my test, I doing some logs at Message.java -> channelRead0(ChannelHandlerContext ctx, Request request)
{code:java}
public void channelRead0(ChannelHandlerContext ctx, Request request)
{
final Response response;
final ServerConnection connection;
long queryStartNanoTime = System.nanoTime();
try
{
assert request.connection() instanceof ServerConnection;
connection = (ServerConnection)request.connection();
if (connection.getVersion().isGreaterOrEqualTo(ProtocolVersion.V4))
ClientWarn.instance.captureWarnings();
QueryState qstate = connection.validateNewMessage(request.type, connection.getVersion(), request.getStreamId());
logger.info("Received: {}, v={}", request, connection.getVersion()); // here is my logging
response = request.execute(qstate, queryStartNanoTime);
logger.info("response : {}", response);// and here is the response.
response.setStreamId(request.getStreamId());
response.setWarnings(ClientWarn.instance.getWarnings());
response.attach(connection);
connection.applyStateTransition(request.type, response.type);
}
{code}
for me userA create table : kscas.tbcas ;userB create table ksgc.tbgc
.
But when I using userA to make a connection through cqlsh : my output log shows all tables are return to
client.
!1.jpg!
So I think if it ok that when doing connection through userA, we just return back userA's schema information like table/keyspace/columns/types .
> Cassandra driver first connection get the user's own schema information
> ------------------------------------------------------------------------
>
> Key: CASSANDRA-15871
> URL: https://issues.apache.org/jira/browse/CASSANDRA-15871
> Project: Cassandra
> Issue Type: Improvement
> Components: Cluster/Schema, Messaging/Client
> Reporter: maxwellguo
> Priority: Normal
> Attachments: 1.jpg
>
>
> We know that cassandra driver making a conenction with the coordinator node first time , the driver may select all the keyspaces/tables/columns/types from the server and cache the data locally.
> For different users they may have different tables and types ,so It is not suitable to get all the meta data cached , It is fine to just cache the user's own schema information not all.
> And doing this is safe and save first time connection resourse.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cassandra.apache.org
For additional commands, e-mail: commits-help@cassandra.apache.org