Skip to main content

undocumented fields in system table PROJECTION_CHECKPOINT_EPOCHS

  • August 7, 2017
  • 1 reply
  • 4 views

MichaelJK

I recently stumbled across these two fields that lack documentation. Searching Confluence was no help.

  • would_recover
  • is_behind_ahm

Both Booleans, I presume. I have a notion what is_behind_ahm is all about, but would_recover is a bit murky. Lifeline, anyone?

1 reply

Jim_Knicely
Forum|alt.badge.img+2
  • Participating Frequently
  • August 7, 2017

"would_recover" appears to indicate that the projection has the minimum CPE for the table (CPE = LGE), and that it can be recovered from a buddy having the higher CPE ...

Example:

dbadmin=> select current_epoch, ahm_epoch, last_good_epoch from system;
 current_epoch | ahm_epoch | last_good_epoch
---------------+-----------+-----------------
            25 |        24 |              24
(1 row)

dbadmin=> create table jim (c1 int) segmented by hash(c1) all nodes;
CREATE TABLE

dbadmin=> insert into jim select 1;
 OUTPUT
--------
      1
(1 row)

dbadmin=> commit;
COMMIT

dbadmin=> select current_epoch, ahm_epoch, last_good_epoch from system;
 current_epoch | ahm_epoch | last_good_epoch
---------------+-----------+-----------------
            26 |        24 |              24
(1 row)

dbadmin=> select node_name from projection_storage where anchor_table_name = 'jim' and row_count > 0;
    node_name
-----------------
 v_test_node0003
 v_test_node0002
(2 rows)

dbadmin=> select node_name, projection_name, checkpoint_epoch, would_recover, is_behind_ahm from projection_checkpoint_epochs where node_name in ('v_test_node0002', 'v_test_node0003');
    node_name    | projection_name | checkpoint_epoch | would_recover | is_behind_ahm
-----------------+-----------------+------------------+---------------+---------------
 v_test_node0003 | jim_b0          |               25 | f             | f
 v_test_node0003 | jim_b1          |               24 | t             | f
 v_test_node0002 | jim_b0          |               24 | t             | f
 v_test_node0002 | jim_b1          |               25 | f             | f
(4 rows)

Wait for the CPE to advance on buddy projection (i.e. moveout occurs)...

dbadmin=> select current_epoch, ahm_epoch, last_good_epoch from system;
 current_epoch | ahm_epoch | last_good_epoch
---------------+-----------+-----------------
            26 |        24 |              25
(1 row)

dbadmin=> select node_name, projection_name, checkpoint_epoch, would_recover, is_behind_ahm from projection_checkpoint_epochs where node_name in ('v_test_node0002', 'v_test_node0003');
    node_name    | projection_name | checkpoint_epoch | would_recover | is_behind_ahm
-----------------+-----------------+------------------+---------------+---------------
 v_test_node0003 | jim_b1          |               25 | f             | f
 v_test_node0003 | jim_b0          |               25 | f             | f
 v_test_node0002 | jim_b0          |               25 | f             | f
 v_test_node0002 | jim_b1          |               25 | f             | f
(4 rows)

Of course, this is just a guess :)