Tendrl / gluster-integration

Extracts all data from a Gluster cluster for consumption by Tendrl
GNU Lesser General Public License v2.1
6 stars 20 forks source link

Unable to identify then brick details using brick name which is come from gluster event #611

Closed GowthamShanmugam closed 6 years ago

GowthamShanmugam commented 6 years ago

When gluster event is raised messages module in gluster-integration is trying to catch the event and create a job to delete monitoring details and deleting brick details from etcd.

Problem is we are storing the exact brick path in the brick object in "brickpath" attr and in "name" attribute we are storing brick path which is modified by tendrl. Problem is when we want to delete or create a flow for delete monitoring data we need to use an attribute "name" in the brick object (because the "name" has modified brick path by tendrl to match with pkey), but we need to replace by / and then only we can use. The problem with this approach is if the brick is created with an underscore in the brick name then this logic will go wrong. Let's take example brick name /gluster/b1_test, while storing collected this will modify as |gluster|b1_test But while storing in etcd fqdn:_gluster_b1test. In monitoring-integration or in gluster event process if we using the "name" and replace by / then it will come like fqdn:/gluster/b1/test. So this won't match with collectd. So dashbaord creation goes wrong and monitoring details are not deleted and brick detail also not deleted.

and brick details in etcd is stored using a field "brick_dir", So we can replace brick hostname in brickpath by pkey and store it in attr "name" in the brick object as it is without replacing / by .

GowthamShanmugam commented 6 years ago

@shtripat @r0h4n @nthomas-redhat suggestion please

shtripat commented 6 years ago

@GowthamShanmugam so the field name under Brick class can ideally be maintained as is with / chars and used for this scenarios. Make sure there is no other impact due to this.

GowthamShanmugam commented 6 years ago

I feel "name' attribute in brick is not used by anyone. Let me confirm this.

GowthamShanmugam commented 6 years ago

For now, i am using hostname from "names" and brick_path form "brick_path"

GowthamShanmugam commented 6 years ago

This issue is not required anymore