Skip to main content
Question

We want to get current epoch and ahm_epoch value from the vertica.log on each node.

  • September 5, 2018
  • 4 replies
  • 20 views

deepvertica

We want to get current epoch and ahm_epoch value from the vertica.log on each node.
Anyone, please advice me how to identify these value from vertica.log

4 replies

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • September 10, 2018

The CE and AHM should be the same across the cluster unless a node is down.

dbadmin=> SELECT get_current_epoch(), get_ahm_epoch();
 get_current_epoch | get_ahm_epoch
-------------------+---------------
               906 |           904
(1 row)

You can find the AHM in the vertica.log file on each node with Linux commands... something like the following (I have 3 nodes, database name is test_db):

[dbadmin@vertica01 ~]$ ssh vertica01 "grep \"GetClusterAHMCandidate: My local node AHM candidate =\" /home/dbadmin/test_db/v_test_db_node0001_catalog/vertica.log | tail -1" | awk 'NF>1{print $NF}'
0x388

[dbadmin@vertica01 ~]$ ssh vertica02 "grep \"GetClusterAHMCandidate: My local node AHM candidate =\" /home/dbadmin/test_db/v_test_db_node0002_catalog/vertica.log | tail -1" | awk 'NF>1{print $NF}'
0x388

[dbadmin@vertica01 ~]$ ssh vertica03 "grep \"GetClusterAHMCandidate: My local node AHM candidate =\" /home/dbadmin/test_db/v_test_db_node0003_catalog/vertica.log | tail -1" | awk 'NF>1{print $NF}'
0x388

Note that the log file stores epochs in HEX. You can convert them to integer in Linux like this:

[dbadmin@vertica01 ~]$ printf '%d\n' "0x388"
904

Similarly, you can find the Current Epoch in Vertica logs...

[dbadmin@vertica01 v_test_db_node0001_catalog]$ ssh vertica01 "grep \"Commit Complete: Txn:\" /home/dbadmin/test_db/v_test_db_node0001_catalog/vertica.log | tail -1" | awk '{print $12}'
0x38a

[dbadmin@vertica01 v_test_db_node0001_catalog]$ ssh vertica02 "grep \"Commit Complete: Txn:\" /home/dbadmin/test_db/v_test_db_node0002_catalog/vertica.log | tail -1" | awk '{print $12}'
0x38a

[dbadmin@vertica01 v_test_db_node0001_catalog]$ ssh vertica03 "grep \"Commit Complete: Txn:\" /home/dbadmin/test_db/v_test_db_node0003_catalog/vertica.log | tail -1" | awk '{print $12}'
0x38a

[dbadmin@vertica01 v_test_db_node0001_catalog]$ printf '%d\n' "0x38a"
906

RaghavA
Forum|alt.badge.img
  • Participating Frequently
  • September 11, 2018

Hi,

Best method is to look for Epoch.log file which is located under your catalog directory:

catalog//v___catalog/Epoch.log


RaghavA
Forum|alt.badge.img
  • Participating Frequently
  • September 11, 2018

Hello Jim,

thanks for the clarification. In our case, most of the time, we find this file in our system so it is easy for us to use it.


deepvertica
  • Author
  • New Participant
  • September 17, 2018

Hello Jim,
Thanks for details clarification...