WARNING 6046: The database is currently 0-safe

Moderator: NorbertKrupa

Post Reply
Brett
Beginner
Beginner
Posts: 49
Joined: Fri Oct 11, 2013 1:19 am

WARNING 6046: The database is currently 0-safe

Post by Brett » Fri Jun 12, 2015 3:38 pm

Hello,

I had a one node cluster running for a dev environment. I then added two more nodes. When I go into vsql, I get the following error:

Code: Select all

[dbadmin@vertica01 ~]$ 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
I've rebalanced the data, but that didn't help.

How can I force the DB to use k=1?

-Brett

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: WARNING 6046: The database is currently 0-safe

Post by JimKnicely » Thu Jun 18, 2015 8:29 pm

Brett,

You may want to identify all of the tables that have projections that have k=0:

Code: Select all

select projection_schema, projection_name, anchor_table_name
  from v_catalog.projections
 where verified_fault_tolerance = 0;
And then...

Create new projections that conform to your new k-safety and then drop the old ones, or create new tables that are k-safe, copy the data from the old tables into the new tables, drop the old tables and then rename the new tables so they have your old table names...

I hope this helps!
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

User avatar
JimKnicely
Site Admin
Site Admin
Posts: 1825
Joined: Sat Jan 21, 2012 4:58 am
Contact:

Re: WARNING 6046: The database is currently 0-safe

Post by JimKnicely » Thu Jul 16, 2015 3:30 pm

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.
Jim Knicely

Image

Note: I work for Vertica. My views, opinions, and thoughts expressed here do not represent those of my employer.

Post Reply

Return to “New to Vertica Database Development”