Eli Mesika has posted comments on this change.

Change subject: core: [RFE]Backup Awareness - DB
......................................................................


Patch Set 1:

(9 comments)

https://gerrit.ovirt.org/#/c/39523/1/packaging/dbscripts/audit_log_sp.sql
File packaging/dbscripts/audit_log_sp.sql:

Line 234:       where vds_id = v_vds_id and log_type = v_log_type;
Line 235: END; $procedure$
Line 236: LANGUAGE plpgsql;
Line 237: 
Line 238: Create or replace FUNCTION DeleteAuditNoOrOldBackupAlert()
> maybe DeleteObsoleteAuditBackupAlert ?
I don't think this is a better name, obsolete covers an old backup case but not 
the case that there is no backup at all
Line 239: RETURNS VOID
Line 240:    AS $procedure$
Line 241: BEGIN
Line 242:       UPDATE audit_log set deleted = true


https://gerrit.ovirt.org/#/c/39523/1/packaging/dbscripts/engine_backup_history_sp.sql
File packaging/dbscripts/engine_backup_history_sp.sql:

> please replace tabs with spaces
will fix
Line 1: CREATE OR REPLACE FUNCTION InsertEngineBackupHistory(v_db_name 
VARCHAR(64),
Line 2:     v_done_at TIMESTAMP WITH TIME ZONE ,
Line 3:     v_passed BOOLEAN,
Line 4:     v_output_message TEXT)


Line 34:     v_status INTEGER,
Line 35:     v_output_message TEXT)
Line 36: RETURNS VOID
Line 37:    AS $procedure$
Line 38: BEGIN
> the audit log constants should be wrapped by comma 'ENGINE_BACKUP_FAILED'..
right, this patch set is only a draft , I did not managed to test it before my 
PTO
will fix
Line 39:     IF v_status = -1 THEN
Line 40:        PERFORM InsertEngineBackupHistory(v_db_name, v_done_at, false, 
v_output_message);
Line 41: 
Line 42:         INSERT INTO audit_log(log_time, log_type_name, log_type, 
severity, message)


Line 36: RETURNS VOID
Line 37:    AS $procedure$
Line 38: BEGIN
Line 39:     IF v_status = -1 THEN
Line 40:        PERFORM InsertEngineBackupHistory(v_db_name, v_done_at, false, 
v_output_message);
> this sp should be formatted so if blocks can be read properly (might be due
I don't see any formatting issue here , please elaborate
Line 41: 
Line 42:         INSERT INTO audit_log(log_time, log_type_name, log_type, 
severity, message)
Line 43:         VALUES(v_done_at, ENGINE_BACKUP_FAILED, 9026, 9, 
v_output_message);
Line 44: 


Line 39:     IF v_status = -1 THEN
Line 40:        PERFORM InsertEngineBackupHistory(v_db_name, v_done_at, false, 
v_output_message);
Line 41: 
Line 42:         INSERT INTO audit_log(log_time, log_type_name, log_type, 
severity, message)
Line 43:         VALUES(v_done_at, ENGINE_BACKUP_FAILED, 9026, 9, 
v_output_message);
> up to this patch i'm not able to now the meaning of 9026, 9024, 9 or any ot
I think this is really straight forward, those are the codes (log_type) and the 
name is in the log_type_name, I see no problem in those insert statements
Please elaborate what else you expect to find here
Line 44: 
Line 45:     ELSIF v_status = 0 THEN
Line 46:         INSERT INTO audit_log(log_time, log_type_name, log_type, 
severity, message)
Line 47:         VALUES(v_done_at, ENGINE_BACKUP_STARTED, 9024, 1, 
v_output_message);


https://gerrit.ovirt.org/#/c/39523/1/packaging/dbscripts/upgrade/03_06_1170_add_backup_awareness.sql
File packaging/dbscripts/upgrade/03_06_1170_add_backup_awareness.sql:

Line 1: CREATE TABLE engine_backup_history(
> i'd refrain from using the _history as suffix for the table name as it serv
will rename
Line 2:     db_name VARCHAR(64),
Line 3:     done_at TIMESTAMP WITH TIME ZONE,
Line 4:     passed BOOLEAN,
Line 5:     output_message TEXT,


Line 1: CREATE TABLE engine_backup_history(
Line 2:     db_name VARCHAR(64),
Line 3:     done_at TIMESTAMP WITH TIME ZONE,
Line 4:     passed BOOLEAN,
> shouldn't boolean columns start with "is_" ? i.e. "is_passed" ?
right , will fix
Line 5:     output_message TEXT,
Line 6:     PRIMARY KEY (db_name, done_at)
Line 7: );
Line 8: 


Line 1: CREATE TABLE engine_backup_history(
Line 2:     db_name VARCHAR(64),
Line 3:     done_at TIMESTAMP WITH TIME ZONE,
Line 4:     passed BOOLEAN,
Line 5:     output_message TEXT,
> maybe backup_message ?
This is not the backup message , this is the output message of the engine-setup 
invocation , so , I don't think it should be changed
Line 6:     PRIMARY KEY (db_name, done_at)
Line 7: );
Line 8: 
Line 9: CREATE UNIQUE INDEX IDX_engine_backup_history ON 
engine_backup_history(db_name, done_at DESC);


Line 5:     output_message TEXT,
Line 6:     PRIMARY KEY (db_name, done_at)
Line 7: );
Line 8: 
Line 9: CREATE UNIQUE INDEX IDX_engine_backup_history ON 
engine_backup_history(db_name, done_at DESC);
> is this index required ? the fetch from the table by the sp file doesn't se
Yes, it is needed , the SP that gets the last backup will do a table scan 
without that since the PK is on (db_name, done_at) and there is no way to 
define DESC on PK creation
Line 10: 


-- 
To view, visit https://gerrit.ovirt.org/39523
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I7824eb8a720bd654e94dada987aee19b9624a516
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Eli Mesika <[email protected]>
Gerrit-Reviewer: Eli Mesika <[email protected]>
Gerrit-Reviewer: Martin PeÅ™ina <[email protected]>
Gerrit-Reviewer: Moti Asayag <[email protected]>
Gerrit-Reviewer: Oved Ourfali <[email protected]>
Gerrit-Reviewer: [email protected]
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to