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

Where are the logs that could help to see different layer's activities? #354

Open
AnDongLi opened this issue Aug 29, 2017 · 8 comments
Open
Labels

Comments

@AnDongLi
Copy link

I'd like to have trace log to see what happens in different layer(berkdb, bdb) or different scope(local, cluster). Where are the log files? How to turn them on?

@akshatsikarwar
Copy link
Contributor

akshatsikarwar commented Aug 30, 2017

Try:

  1. SQL logging: exec procedure sys.cmd.send("reql longsqlrequest 0")
  2. SQLite opcodes: exec procedure sys.cmd.send("sql debug on")
  3. BPLog opcodes: exec procedure sys.cmd.send("debg 1000")

@akshatsikarwar
Copy link
Contributor

When running clustered, first 2 will produce trace on replicant. While 3 will produce trace on master.

@AnDongLi
Copy link
Author

Thanks.
From akshatsikarwar's answer I got to the document docs/pages/operating/logs.md which provides more details like the default path and name of logs:
$COMDB2_ROOT/var/log/cdb2/.
Examples:
/opt/bb/var/log/cdb2/customerdb.trc.c
/opt/bb/var/log/cdb2/customerdb.statreqs
/opt/bb/var/log/cdb2/customerdb.longreqs

@AnDongLi
Copy link
Author

AnDongLi commented Aug 30, 2017

When I ran this command in dev container I got the error:
cdb2sql testdb @Node1 "exec procedure sys.cmd.send('sql debug on')"
[exec procedure sys.cmd.send('sql debug on')] failed with rc -1 cdb2_run_statement_typed_int: Cannot connect to db

It works when I ran it in node1 container:
cdb2sql testdb @Node1 "exec procedure sys.cmd.send('sql debug on')"
(out='SQL debug mode is now on')

Not sure if it is a bug. There is no problem to set SQL logging in dev container.

@AnDongLi
Copy link
Author

Which log file contains bplog, sqlite log?

@akshatsikarwar
Copy link
Contributor

akshatsikarwar commented Aug 31, 2017

That trace will go to terminal. Add logmsg level debug to the db's lrl to enable.

@AnDongLi
Copy link
Author

AnDongLi commented Sep 6, 2017

I have a docker cluster(node1..node5) and node2 is the master.
I started the cluseter with 'docker-compose up' in one terminal and ran 'cdb2sql testdb @node5 'insert into numbers values(5)'' in dev container in another terminal, I saw these logs in the first terminal window:
node5 | 2017/09/06 04:17:39 creating a temp table object 0x76d1818
node5 | 2017/09/06 04:17:39 creating a temp table object 0x8fa4888
node5 | 2017/09/06 04:17:39 creating a temp table object 0x8fa4b30
node5 | 2017/09/06 04:17:39 creating a temp table object 0x9304a50
node5 | 2017/09/06 04:17:39 creating a temp table object 0x9304cf8
node2 | 2017/09/06 04:17:39 SORESE# node5 SOCKSQL RQST 1:REQ blockop BLOCK OPCODES: 4 reqs TIME +2
node2 | 2017/09/06 04:17:39 SORESE# node5 SOCKSQL RQST 1:REQ blockop 7f9b62bf7700:START TRANSACTION ID 0x6293e70 DB 0 'sqlite_stat1' TIME +2
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_USE 0 BLOCK2_USE(802) offset after hdr 0x7f9b752a730csqlite_stat1' TIME +2
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_USE DB 'sqlite_stat1') offset after hdr 0x7f9b752a730csqlite_stat1' TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_TZ 1 BLOCK2_TZ(810) offset after hdr 0x7f9b752a734ccsqlite_stat1' TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_SOCK_SQL 2 BLOCK2_SOCK_SQL(815) offset after hdr 0x7f9b752a737ce_stat1' TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_SOCK_SQL socksql received query 'insert into numbers values(5)'ce_stat1' TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_SOCK_SQL block2_sorese received from node node5mbers values(5)'ce_stat1' TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_SEQV2 3 BLOCK2_SEQV2(824) offset after hdr 0x7f9b752a73a8)'ce_stat1' TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_SEQV2 add_record: TBL numbers TAG .ONDISK dat_add RRN 2 GENID 0x2000100e376af59 DTALEN 5 RC 0 DATA 0880000005 TIME +3
node2 | 2017/09/06 04:17:39 7f9b62bf7700:tran 0x6293e70:BLOCK2_SEQV2 add_record: TBL numbers TAG .ONDISK ix_addk IX 0 LEN 5 KEY 0880000005 RC 0DTALEN 5 RC 0 DATA 0880000005 TIME +3
node2 | 2017/09/06 04:17:39 0x6293e70:TRANSACTION COMMITTED, NUM_REQS 4 RC 0DTALEN 5 RC 0 DATA 0880000005 TIME +5
node2 | 2017/09/06 04:17:39 0x6293e70:(nil):TRANSACTION SIZE 465 TIMEOUT 10000 REPTIME 1 RATE 46580000005 TIME +5
node2 | 2017/09/06 04:17:39 0x6293e70:iq->reply_len=28 RC 0E 465 TIMEOUT 10000 REPTIME 1 RATE 46580000005 TIME +5
node2 | 2017/09/06 04:17:39 0x6293e70:sorese returning rqid=1 d6e34182-c1e2-4c88-a1e9-bc37ce3de840 node=node5 type=2 nops=1 rcout=0 retried=1 RC=0 errval=0 TIME +5
node2 | 2017/09/06 04:17:39 nreads 0 (0 bytes) nwrites 0 (0 bytes) nfsyncs 0 nmempgets 22

Is there BPlog there?

@AnDongLi
Copy link
Author

I found cdb2_printlog command line help is a bit misleading:
-h home -- Set db home

For me db home is the directory that contains data files.
But actually this tool expects the home as dbhome/logs.

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

No branches or pull requests

2 participants