Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to report trace only once during pagination #2015

Open
wants to merge 1 commit into
base: 4.x
Choose a base branch
from

Conversation

lukasz-antoniak
Copy link
Member

Fixes CASSJAVA-71.

Currently, when client executes below code:

ResultSet rs = session.execute(SimpleStatement.newInstance("select * from kv").setPageSize(2).setTracing(true));
Iterator<Row> iter = rs.iterator();
while (iter.hasNext()) {
    iter.next();
}

The following trace events are generated:

cqlsh> select session_id, command, coordinator, duration, parameters, started_at from system_traces.sessions;

 session_id                           | command | coordinator | duration | parameters                                                                                                              | started_at
--------------------------------------+---------+-------------+----------+-------------------------------------------------------------------------------------------------------------------------+---------------------------------
 f69b1c00-e7d7-11ef-911d-0b57c0dc9621 |   QUERY |   127.0.0.1 |     1255 | {'consistency_level': 'LOCAL_ONE', 'page_size': '2', 'query': 'select * from kv', 'serial_consistency_level': 'SERIAL'} | 2025-02-10 17:53:41.312000+0000
 f69c2d70-e7d7-11ef-911d-0b57c0dc9621 |   QUERY |   127.0.0.1 |      918 | {'consistency_level': 'LOCAL_ONE', 'page_size': '2', 'query': 'select * from kv', 'serial_consistency_level': 'SERIAL'} | 2025-02-10 17:53:41.319000+0000
 f69c5480-e7d7-11ef-911d-0b57c0dc9621 |   QUERY |   127.0.0.1 |      638 | {'consistency_level': 'LOCAL_ONE', 'page_size': '2', 'query': 'select * from kv', 'serial_consistency_level': 'SERIAL'} | 2025-02-10 17:53:41.320000+0000
 f69bdf50-e7d7-11ef-911d-0b57c0dc9621 |   QUERY |   127.0.0.1 |     1119 | {'consistency_level': 'LOCAL_ONE', 'page_size': '2', 'query': 'select * from kv', 'serial_consistency_level': 'SERIAL'} | 2025-02-10 17:53:41.317000+0000

After disabling report-every-page-fetch, only first page generates trace event:

cqlsh> select session_id, command, coordinator, duration, parameters, started_at from system_traces.sessions;

 session_id                           | command | coordinator | duration | parameters                                                                                                              | started_at
--------------------------------------+---------+-------------+----------+-------------------------------------------------------------------------------------------------------------------------+---------------------------------
 e8f6ad80-e7d7-11ef-911d-0b57c0dc9621 |   QUERY |   127.0.0.1 |     1628 | {'consistency_level': 'LOCAL_ONE', 'page_size': '2', 'query': 'select * from kv', 'serial_consistency_level': 'SERIAL'} | 2025-02-10 17:53:18.424000+0000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant