Sahina Bose has posted comments on this change.
Change subject: engine: Get gluster hooks query
......................................................................
Patch Set 9: (9 inline comments)
See inline comments related to db tables
....................................................
File backend/manager/dbscripts/gluster_hooks_sp.sql
Line 42: WHERE id = v_id;
Line 43: END; $procedure$
Line 44: LANGUAGE plpgsql;
Line 45:
Line 46:
Cluster Id and name combination are not unique, rt? Won't this return a list?
Line 47: Create or replace FUNCTION GetGlusterHookByName(v_cluster_id UUID,
v_name VARCHAR(1000))
Line 48: RETURNS SETOF gluster_hooks
Line 49: AS $procedure$
Line 50: BEGIN
Line 117: WHERE id = v_id;
Line 118: END; $procedure$
Line 119: LANGUAGE plpgsql;
Line 120:
Line 121:
Should clusterid be an updateable field?
Line 122: Create or replace FUNCTION UpdateGlusterHook(v_id UUID,
Line 123: v_cluster_id UUID,
Line 124: v_gluster_command
VARCHAR(1000),
Line 125: v_stage VARCHAR(100),
Line 140: WHERE id = v_id;
Line 141: END; $procedure$
Line 142: LANGUAGE plpgsql;
Line 143:
Line 144:
remove tabs
Line 145: Create or replace FUNCTION InsertGlusterServerHook(v_hook_id UUID,
Line 146: v_host_id UUID,
Line 147: v_checksum VARCHAR(100),
Line 148: v_status VARCHAR(100))
Line 153: VALUES(v_hook_id, v_host_id, v_checksum, v_status);
Line 154: END; $procedure$
Line 155: LANGUAGE plpgsql;
Line 156:
Line 157:
Minor: Seems very similar in name to GetGlusterServerHooks
Line 158: Create or replace FUNCTION GetGlusterServerHook(v_hook_id UUID,
v_host_id UUID)
Line 159: RETURNS SETOF gluster_server_hooks
Line 160: AS $procedure$
Line 161: BEGIN
....................................................
File backend/manager/dbscripts/upgrade/03_02_0400_add_gluster_hooks_table.sql
Line 1: Create or replace FUNCTION __temp_fn_db_add_gluster_hooks_tables()
Line 2: RETURNS void
Line 3: AS $function$
Line 4: BEGIN
Line 5: -- Add gluster_hooks table
Isn't checksum required in the gluster_hooks table? This should be used to
compare if each node has the same copy of the hook script or not.
Also, remove tabs
Line 6: CREATE TABLE gluster_hooks
Line 7: (
Line 8: id UUID NOT NULL,
Line 9: cluster_id UUID NOT NULL references
vds_groups(vds_group_id) on delete cascade,
Line 19: ) WITH OIDS;
Line 20: CREATE INDEX IDX_gluster_hooks_cluster_id ON
gluster_hooks(cluster_id);
Line 21: CREATE UNIQUE INDEX IDX_gluster_hooks_unique ON
gluster_hooks(cluster_id, gluster_command, stage, name);
Line 22:
Line 23: -- Add gluster_server_hooks table
remove tabs
Line 24: CREATE TABLE gluster_server_hooks
Line 25: (
Line 26: hook_id UUID NOT NULL references gluster_hooks(id) on
delete cascade,
Line 27: host_id UUID default NULL,
Line 29: status VARCHAR(100),
Line 30: _create_date TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT
LOCALTIMESTAMP,
Line 31: _update_date TIMESTAMP WITH TIME ZONE
Line 32: ) WITH OIDS;
Line 33: CREATE INDEX IDX_gluster_server_hooks ON
gluster_server_hooks(hook_id, host_id);
When is host_id null - is it to indicate this is the default value stored in
engine for cluster?
Line 34:
Line 35: END; $function$
Line 36: LANGUAGE plpgsql;
Line 37:
....................................................
File
backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/businessentities/gluster/GlusterHookEntity.java
Line 21:
Line 22: private GlusterHookStage stage;
Line 23:
Line 24: private String name;
Line 25:
Can this not be an enum - Binary/Non-binary?
Line 26: private String contentType;
Line 27:
Line 28: private boolean inSync;
Line 29:
....................................................
File
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/gluster/GlusterHooksDaoDbFacadeImpl.java
Line 46: }
Line 47: return glusterHook;
Line 48: }
Line 49:
Line 50: @Override
Table has no unique constraint on clusterid & name alone - so this combination
could return multiple rows. Is clusterid & hook name combination unique?
Line 51: public GlusterHookEntity getByName(Guid clusterId, String
hookName) {
Line 52: GlusterHookEntity glusterHook = getCallsHandler().executeRead(
Line 53: "GetGlusterHookByName", glusterHookRowMapper,
Line 54: getCustomMapSqlParameterSource()
--
To view, visit http://gerrit.ovirt.org/10650
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: If8b2d261ead720fccea6884acbc806ec79e52b36
Gerrit-PatchSet: 9
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Selvasundaram <[email protected]>
Gerrit-Reviewer: Gilad Chaplik <[email protected]>
Gerrit-Reviewer: Itamar Heim <[email protected]>
Gerrit-Reviewer: Kanagaraj M <[email protected]>
Gerrit-Reviewer: Omer Frenkel <[email protected]>
Gerrit-Reviewer: Sahina Bose <[email protected]>
Gerrit-Reviewer: Selvasundaram <[email protected]>
Gerrit-Reviewer: Shireesh Anjal <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches