FYI, I believe the easiest fix for this issue is to use the admintools command line tool REBALANCE_DATA with a K=1.
Example:
On 1 node DB I created these tables:
Code: Select all
dbadmin=> create table test_seg (c1 int primary key) segmented by hash(c1) all nodes;
CREATE TABLE
dbadmin=> create table test_unseg (c1 int primary key) unsegmented all nodes;
CREATE TABLE
After adding two nodes using admintools and allowing admintools to "rebalance" the data using a proposed k safety of 1, I still get the 6046 warning when launching vsql:
Code: Select all
[dbadmin@v1 ~]$ vsql
WARNING 6046: The database is currently 0-safe, which could result in catastrophic data loss in the event of a failure. Do not use k=0 in a production environment. For test, dev or other non-production environments, K=0 may be acceptable however Vertica still recommends a minimum value of K=1
Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
dbadmin=> select mark_design_ksafe(1);
mark_design_ksafe
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Current design does not meet the requirements for K = 1.
Current design is valid for K = 0.
Projection public.test_seg_super has insufficient buddy projections; it has 0 buddies
(1 row)
Notice that the issue is on the segmented table.
Fix:
Code: Select all
[dbadmin@v1 ~]$ admintools -t rebalance_data -d test -k 1
Database Designer started.
This process could take a long time; allow it to complete uninterrupted.
Use Ctrl+C if you must cancel the session.
Re-balance script is located in /home/dbadmin/extend_catalog_rebalance.sql
Starting data re-balancing...
NOTICE 4076: No data rebalancing required for replicated projections
Re-balance complete.
Designer finished
[dbadmin@v1 ~]$ vsql
Welcome to vsql, the Vertica Analytic Database interactive terminal.
Type: \h or \? for help with vsql commands
\g or terminate with semicolon to execute query
\q to quit
dbadmin=> select current_fault_tolerance from system;
current_fault_tolerance
-------------------------
1
(1 row)
The fix worked because Vertica was able to create the needed buddy projection on the segmented table.