Thursday, 2016-02-18

*** Qiming has quit IRC00:16
*** sridhar_ram1 has joined #senlin00:31
*** sridhar_ram has quit IRC00:33
*** sridhar_ram1 has quit IRC01:06
*** Qiming has joined #senlin01:14
*** xuhaiwei has joined #senlin01:20
*** Yanyanhu has joined #senlin01:37
*** elynn has joined #senlin01:56
elynnMorning :)02:03
*** elynn_ has joined #senlin02:05
*** elynn has quit IRC02:09
openstackgerritMerged openstack/senlin: Set default isolation_level to READ_COMMITTED  https://review.openstack.org/28109302:15
*** elynn__ has joined #senlin02:15
*** elynn_ has quit IRC02:17
*** elynn_ has joined #senlin02:21
openstackgerritMerged openstack/senlin: Fix race condition in service delete  https://review.openstack.org/28106902:23
*** haiwei has joined #senlin02:24
*** elynn__ has quit IRC02:24
*** lixinhui_ has joined #senlin02:33
openstackgerritDi XiaoLi proposed openstack/senlin: Raise InvalidParameter exception when get resource with invalid sort key  https://review.openstack.org/28160902:37
openstackgerritMerged openstack/senlin: Add cluster check and recover into API  https://review.openstack.org/28067702:41
*** haiwei_ has joined #senlin02:47
*** haiwei has quit IRC02:48
*** sridhar_ram has joined #senlin03:19
Qimingdixiaoli there?03:21
dixiaoliyes03:21
*** yuanying_ has quit IRC03:21
Qimingcommented on your patch03:21
Qimingit is a good starting point03:21
Qimingif you need more clarification, please speak up03:21
*** sridhar_ram has quit IRC03:22
openstackgerritCindia-blue proposed openstack/senlin: Revise node check and recover parameters  https://review.openstack.org/28161903:24
openstackgerritMerged openstack/senlin: Enforce multi-tenancy for cluster find  https://review.openstack.org/28126403:32
openstackgerritMerged openstack/senlin: Enforce multi-tenancy for node find  https://review.openstack.org/28129503:32
openstackgerritMerged openstack/senlin: Revise node check and recover parameters  https://review.openstack.org/28161903:39
*** yuanying has joined #senlin03:39
dixiaoliQiming, I saw your comments. I partly agree with your comments. I think we just need step1.03:40
dixiaoliSo my thought is:Add whitelist list check in method parse_sort_param in senlin.common.utils is ok.03:40
dixiaoliSince the parse_sort_param method have already raised InvalidParameter exception twice, there is no need to eliminate the DB level parsing which you said in step203:42
dixiaoliHow do u think about my thoughts ?03:44
*** yuanying has quit IRC03:55
*** yuanying has joined #senlin04:05
*** yuanying_ has joined #senlin04:07
*** yuanying has quit IRC04:09
*** elynn_ has quit IRC04:40
openstackgerritDi XiaoLi proposed openstack/senlin: Raise InvalidParameter exception when get resource with invalid sort key  https://review.openstack.org/28160905:01
*** elynn_ has joined #senlin05:08
*** elynn_ has quit IRC05:12
*** elynn_ has joined #senlin05:13
*** zzxwill has joined #senlin05:14
*** lixinhui_ has quit IRC05:18
*** zzxwill has quit IRC05:25
openstackgerritQiming Teng proposed openstack/senlin: Enforce multi-tenancy for event find  https://review.openstack.org/28164005:41
openstackgerritDi XiaoLi proposed openstack/senlin: Raise InvalidParameter exception when get resource with invalid sort key  https://review.openstack.org/28160905:51
openstackgerritMerged openstack/senlin: Enforce multi-tenancy for policy-find  https://review.openstack.org/28071005:52
openstackgerritMerged openstack/senlin: Remove some useless methods in rpc client  https://review.openstack.org/28102105:52
openstackgerritMerged openstack/senlin: Avoid using '__class__.__name__' when possible  https://review.openstack.org/28103305:53
openstackgerritMerged openstack/senlin: Enforce multi-tenancy for actions  https://review.openstack.org/28133005:55
*** sridhar_ram has joined #senlin06:05
*** lixinhui_ has joined #senlin06:06
*** sridhar_ram1 has joined #senlin06:12
*** sridhar_ram has quit IRC06:13
openstackgerritQiming Teng proposed openstack/senlin: Rename SenlinBadRequest to BadRequest  https://review.openstack.org/28165606:17
*** PennyLiu has joined #senlin06:20
*** sridhar_ram1 has quit IRC06:28
Yanyanhuhi, Qiming, the action scheduling is broken for project_safe is enabled by default now. I have proposed a bug report here.06:29
Yanyanhuworking on a fix for it06:29
QimingYanyanhu, local functional testing didn't complain a thing06:29
Qimingcould it be your database is old?06:30
Yanyanhuoh, I see06:30
Yanyanhumy fault06:30
YanyanhuI need to upgrade my db06:30
Yanyanhuthanks :)06:30
Qimingdo a 'senlin-manage db_sync', that's all06:30
Yanyanhuyes06:30
Qimingthough that could be the reason why the latest code doesn't work for you ...06:31
QimingI did noticed some mysql-level error reports the first time I ran functional tests locally06:31
QimingI tried to reproduce the problem but I wasn't able to do that06:32
Qimingit was something like 'operation out of order' ...06:32
Yanyanhuhmm, let me test it again06:32
Qiminggreat06:32
Yanyanhuthat error still happened...06:34
Yanyanhuhttps://bugs.launchpad.net/senlin/+bug/154688106:34
openstackLaunchpad bug 1546881 in senlin "Error happened when scheduling an action" [Critical,New] - Assigned to Yanyan Hu (yanyanhu)06:34
Yanyanhulet me check my db table06:34
YanyanhuI didn't see any output when performing db update using senlin-manage db_sync06:35
Qimingso your db schema is up to date06:36
Yanyanhuaction table has been the latest version06:36
Yanyanhuhmm06:36
Qimingyep, can see that06:36
Qimingso the problem is ... in ActionProc, the conext is different06:37
Yanyanhuyes06:37
Yanyanhuit is06:37
Yanyanhuit's admin context actually06:37
Qimingand the project could be empty06:37
Yanyanhuem, it's different from the project of requester06:37
Qimingthis is actually a global bug06:37
Qimingif not context.is_admin and project_safe and context.project != objec.context:06:38
Qiming    return None06:38
Yanyanhuyes, seems some bugs here06:38
Yanyanhulet me check it06:38
Qimingokay06:39
*** branw has joined #senlin06:44
Yanyanhuhi, Qiming, currently, is_admin flag will not be checked when performing ***_get() DB operations06:44
Qimingyes, that is the 'global' bug I was referring to06:44
Yanyanhuoh06:45
Qimingwould you jump onto it?06:45
Yanyanhuso how should we fix it?06:45
Yanyanhuok06:45
Yanyanhuso you mean we add it06:45
Qimingmaybe a refactor of the sqlalchemy.api06:45
Yanyanhuyes, I think so06:46
Qimingwhere ever we are checking project_safe, we should make an exception for context.is_admin06:46
Yanyanhuright06:46
Qimingokay, it's yours06:46
Yanyanhuok06:46
Yanyanhuwill fix it asap06:47
Yanyanhuit blocks all actions execution...06:47
Qimingweird thing is it worked fine for me ...06:47
Yanyanhuyea...06:48
Qimingdixiaoli, xuhaiwei online?06:48
dixiaoliQiming, yes06:48
Qimingregarding https://review.openstack.org/#/c/281609/06:48
Qimingseems we need a quick sync06:48
QimingI'm okay getting it in06:49
haiwei_yes06:49
Qiminghaiwei's comment on code optimization makes sense06:49
Qimingwhat I want to bring up is about the next step06:49
haiwei_check the paras in service layer?06:50
Qimingit is suboptimal to call common.utils.parse_sort_param twice06:50
Qimingif we want to enforce a validation, it should be done earlier along the call path06:50
haiwei_agree06:51
QimingI mean, in the db layer, we should have a validated 'sort' param, what it has to do is to ensure that 'id' is in the sort_keys before passing to oslo_db layer06:51
haiwei_currently this is checking is done in db/api06:53
Qimingthere are cases where we are adding default sorting keys .. so the db layer '_parse_sort_param' should be improved06:53
Qimingso ... next step06:53
Qimingwe need two util functions, one focusing on validation, invoked from engine service layer06:54
Qimingthe other remain in the db layer, focusing on some further augmentation of the param06:54
dixiaolifor " ensure that 'id' is in the sort_keys" , I think we can do it in service layer too.06:55
Qimingdixiaoli, that is an option, agree06:55
haiwei_yes, I agree06:55
Qiminghowever, db layer apis are called not just from service layer06:56
haiwei_what do you mean by 'further augmentation of the param'?06:56
Qimingby further augmentation, I mean: 1) make sure id is in sort_keys, so that no matter user specified sort or not, the resulted list is always predictable; 2) add default_sorting_key06:57
dixiaoli_get_sort_params() method in db.sqlalchemy.api06:59
dixiaolihaiwei_, _get_sort_params() method in db.sqlalchemy.api  did the 'further augmentation of the param'07:00
haiwei_so about service layer validation, you will add a new method?07:01
Qimingyes, mostly a revision of the existing function07:02
Qiminglet's get 281609 in07:02
QimingI'll explain the idea via code07:03
haiwei_ok07:03
openstackgerritYanyan Hu proposed openstack/senlin: Enable is_admin check in DB APIs  https://review.openstack.org/28166707:07
Yanyanhuhi, Qiming, patch is proposed here. I plan to add unit tests for this change in another patch07:08
Yanyanhusince this issue breaks senlin action workflow, hope fix it asap07:08
Qimingyes07:12
Qimingreviewed07:12
Qimingmostly minor nits07:12
Qimingunderstand the urgency of getting this fixed07:12
openstackgerritMerged openstack/senlin: Raise InvalidParameter exception when get resource with invalid sort key  https://review.openstack.org/28160907:12
openstackgerritDi XiaoLi proposed openstack/python-senlinclient: Add OpenstackClient plugin for cluster profile list  https://review.openstack.org/28105507:12
Yanyanhugot it07:23
openstackgerritYanyan Hu proposed openstack/senlin: Enable is_admin check in DB APIs  https://review.openstack.org/28166707:26
QimingYanyanhu, +2'ed07:29
Yanyanhuthanks :)07:30
openstackgerritMerged openstack/senlin: Enable is_admin check in DB APIs  https://review.openstack.org/28166707:39
openstackgerritMerged openstack/python-senlinclient: Add OpenstackClient plugin for cluster profile list  https://review.openstack.org/28105507:54
haiwei_hi, Yanyanhu, Qiming, I used a demo user to create a node, why is_admin is True?08:12
Yanyanhuthe demo user has admin role?08:13
Qimingsmells like a configuration thing08:17
haiwei_how to check a user's role08:18
Qimingopenstack08:18
Qimingyou got to be admin to list roles and role assignments08:19
Qimingit is a restriction of keystone08:19
haiwei_got it, my demo user only has 'Member' and 'anotherrole' role08:19
Qimingwell, it depends08:20
Qimingmaybe that is not true08:20
Qimingyou got to switch to keystone v3 to find it out08:20
haiwei_you can get user role by 'openstack user role list USERNAME'08:20
haiwei_$ openstack user role list demo +----------------------------------+-------------+---------+------+ | ID                               | Name        | Project | User | +----------------------------------+-------------+---------+------+ | 59c481869c634f8cba5f68d818174b01 | anotherrole | demo    | demo | | 6f6693e1b8ba4218bb398a85ecc2bb16 | Member      | demo    | demo | +----------------------------------+-------------+---------+----08:21
openstackgerritQiming Teng proposed openstack/senlin: Refactor sorting param parsing at db layer  https://review.openstack.org/28168908:22
haiwei_my demo user does not have 'admin' role, but is_admin is still True08:22
Yanyanhuhi, haiwei_ where the is_admin check return true?08:23
Qiminghaiwei, you are not using keystone v308:23
haiwei_in db/sqlachelmy/api.py08:23
Qimingthe output from your command is misleading08:23
Qimingto switch to use keystone v3 when using openstackclient08:24
haiwei_ok08:24
Qimingyou have to append a --os-identity-api-version=308:24
Qimingto you openstack command08:24
Qimingafter switching to v308:24
Qimingyou won't have 'user role list' command08:24
Qimingit becomes 'role assignment list'08:25
Qimingit is confusing sometimes, so I really hate keystone v2 is still being used08:26
Yanyanhuhaiwei_, which table you are accessing. The context using to access db could be different from the context of requester in many cases.08:26
Yanyanhue.g. in ActionProc, senlin engine uses its own admin context(db session) to access action table08:28
haiwei_action table, Yanyanhu08:28
haiwei_in action_get method08:28
Yanyanhuif this is a get show request from user08:29
Yanyanhuis_admin flag should be false if this user doesn't have admin role08:29
Qiminghaiwei_, dixiaoli, #281689 is a refactor at the DB layer, please help review when u r not so busy08:29
Yanyanhusorry, a action show request08:29
dixiaoliQiming, ok08:30
Yanyanhusince senlin engine service interfaces will parse the context transmitted from rpc08:30
haiwei_I confirmed in keystone v3, demo user doesn't have admin role08:31
Yanyanhuand extract some useful info like, user,project,domain and use them as parameters to create action08:32
Yanyanhulet me find an example code for you08:32
Yanyanhuhttp://git.openstack.org/cgit/openstack/senlin/tree/senlin/engine/service.py#n71508:33
Yanyanhuthen these information will be handle here when initilizing an action object08:35
Yanyanhuhttp://git.openstack.org/cgit/openstack/senlin/tree/senlin/engine/actions/base.py#n9808:35
Yanyanhuso the action.context is actually not the context of requester08:36
YanyanhuThis is because we planned to remove context from action08:37
Yanyanhuwe believe only db_session is needed by action to finish its job08:37
Yanyanhuso we don't need to transmit the entire context through rpc08:37
Yanyanhuonly transmitting user informatoin and rebuilding a db session object will be enough08:38
Yanyanhualthough this work has not been done completely :)08:38
Yanyanhuthat's why you can see some TODO about db session in action base module08:39
haiwei_you mean the 'project' of context should be None?08:39
Yanyanhuno, it won't08:39
haiwei_while action's project is not None08:39
haiwei_from my test, context.project turned out to be None08:40
Yanyanhuunless the project property of original context is None08:40
Yanyanhuwhere did you put the test code08:41
haiwei_wait a minite08:41
Yanyanhuok08:42
xuhaiweihttp://paste.openstack.org/show/487371/08:42
Yanyanhucontext.project is None?08:44
Yanyanhubut not action.project08:45
Yanyanhuhttp://git.openstack.org/cgit/openstack/senlin/tree/senlin/engine/scheduler.py#n4308:45
Yanyanhuand here: http://git.openstack.org/cgit/openstack/senlin/tree/senlin/engine/actions/base.py#n50008:46
haiwei_yes, context.project is None08:46
Yanyanhuthis is an admin_context which used by engine to schedule actions08:46
Yanyanhuso it doesn't belong to any user08:46
Yanyanhuand project as well, so only is_admin Flag is set08:47
haiwei_yes08:47
Yanyanhuso in line500 in action/base.py, engine accesses db to query action table with this context08:48
Yanyanhuthat's why you see context.project is None08:48
Yanyanhuand also is_admin is True :)08:49
haiwei_ok, makes sense to me08:49
haiwei_I will test some more08:49
Yanyanhuok :)08:50
openstackgerritQiming Teng proposed openstack/senlin: Util function 'validate_sort_param'  https://review.openstack.org/28169608:52
openstackgerritDi XiaoLi proposed openstack/python-senlinclient: Add OpenstackClient plugin for cluster profile delete  https://review.openstack.org/28110708:54
openstackgerritLiuqing Jing proposed openstack/senlin: Update devstack comment  https://review.openstack.org/28170309:03
*** Qiming has quit IRC09:06
openstackgerritYanyan Hu proposed openstack/senlin: Add unit test for is_admin check in DB interfaces  https://review.openstack.org/28171409:26
*** lixinhui_ has quit IRC09:38
*** Yanyanhu has quit IRC09:52
*** elynn_ has quit IRC09:52
openstackgerritDi XiaoLi proposed openstack/python-senlinclient: Add OpenstackClient plugin for cluster profile create  https://review.openstack.org/28122909:55
*** openstackgerrit has quit IRC10:02
*** openstackgerrit has joined #senlin10:03
*** PennyLiu has quit IRC10:41
openstackgerritDi XiaoLi proposed openstack/python-senlinclient: Add OpenstackClient plugin for cluster profile update  https://review.openstack.org/28175810:50
*** Qiming has joined #senlin11:56
openstackgerritDi XiaoLi proposed openstack/python-senlinclient: Add OpenstackClient plugin for cluster profile type list  https://review.openstack.org/28180912:45
*** Qiming has quit IRC13:30
*** Qiming has joined #senlin13:32
*** Qiming has quit IRC13:32
*** Qiming has joined #senlin13:34
*** Liuqing has joined #senlin13:38
LiuqingHI https://github.com/openstack/senlin/blob/master/devstack/plugin.sh#L17  should the cmd cleanup_senlin behind install_senlin?,13:39
*** PennyLiu has joined #senlin13:46
*** Liuqing has quit IRC14:02
openstackgerritMerged openstack/senlin: Refactor sorting param parsing at db layer  https://review.openstack.org/28168914:23
openstackgerritQiming Teng proposed openstack/senlin: Util function 'validate_sort_param'  https://review.openstack.org/28169614:46
*** Qiming has quit IRC15:49
*** zigo has quit IRC16:03
*** zigo has joined #senlin16:05
*** PennyLiu has quit IRC16:28
*** sridhar_ram has joined #senlin17:13
openstackgerritAyush Garg proposed openstack/python-senlinclient: Add filters option to profile-list command  https://review.openstack.org/28200118:39
*** sridhar_ram1 has joined #senlin19:02
*** sridhar_ram has quit IRC19:04
*** sridhar_ram1 has quit IRC21:03
*** sridhar_ram has joined #senlin21:04
*** sridhar_ram has quit IRC21:41
*** sridhar_ram has joined #senlin21:44
*** sridhar_ram has quit IRC22:15
*** sridhar_ram has joined #senlin22:18
*** Qiming has joined #senlin23:33
*** xuhaiwei has quit IRC23:39
*** openstackgerrit has quit IRC23:47
*** openstackgerrit_ is now known as openstackgerrit23:47
*** openstackgerrit_ has joined #senlin23:48
*** openstackgerrit_ is now known as openstackgerrit23:48
*** openstackgerrit_ has joined #senlin23:49
*** openstackgerrit_ has quit IRC23:55
*** openstackgerrit_ has joined #senlin23:57

Generated by irclog2html.py 2.14.0 by Marius Gedminas - find it at mg.pov.lt!