root@c910f03c05k05:~# cat /etc/os-release
NAME="Ubuntu"
VERSION="14.04.1 LTS, Trusty Tahr"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.04.1 LTS"
VERSION_ID="14.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
root@c910f03c05k05:~# uname -i
ppc64le
root@c910f03c05k05:~# lsxcatd -v
Version 2.9 (git commit 1967441266f3a2b25e82b711abdbd17d7209dff6, built Wed Dec 3 00:32:27 EST 2014)
root@c910f03c05k05:~# lsxcatd -d
cfgloc=mysql:dbname=xcatdb;host=10.3.5.5|xcatadmin
dbengine=mysql
dbname=xcatdb
dbhost=10.3.5.5
dbadmin=xcatadmin
root@c910f03c05k05:~# while true;do lsdef c910f03c05k06 -i status; tabdump -w "node==c910f03c05k06" nodelist;done
Object name: c910f03c05k06
status=booting
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=booting
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=booting
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=booting
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=booting
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
Object name: c910f03c05k06
status=booting
"c910f03c05k06","c910f03c05vms,vm,all,wjx","booting","12-11-2014 00:31:49",,,,,"synced","12-10-2014 22:14:59",,,
The symptom of this issue was that when you run 'lsdef <node> -i status', sometimes you found that the return value for 'status' attribute is NULL even it does have value.</node>
I dug into this issue and found it's a defect of our code. The root cause was the {_use_cache} flag of nodelist table object was turned on when expanding NodeRange (this always happens in xcatd that before getting in the plugin), but it was not turned off after the NodeRange handling. Then the status of {_use_cache} would affect the next access to the nodelist table.
The procedure to run 'lsdef <node> -i status':</node>
Call Noderange.pm->noderange() to expand 'noderange'.
nodelist->{_use_cache} = ON (but the cache only includes 'node, groups' columns.)
Access several tables to get attributes. The table list is stored in hash %tableattrs (use table name as key).
For each table, call Table.pm->getNodesAttribs() to get target columns.
At end of getNodesAttribs() when target is any table, the nodelist->{_use_cache} will be turn off. That means the nodelist->{_use_cache} only is ON for the first table.
The tables in %tableattrs include 'nodetype, nodehm and nodelist'.
On sles11.2 (The RH should be same with sles), the sentence 'keys %tableattrs' always returns the tables with a fixed order 'nodetype, nodehm and nodelist'. When handle the first table 'nodetype', the nodelist->{_use_cache} will be turned off. Then when handling the third table 'nodelist', the nodelist->{_use_cache} is OFF. Then table cache will NOT be used, the 'nodelist.status' can get the correct value.
But on Ubuntu 14, the return list of 'keys %tableattrs' is not fixed. Sometimes it returns 'nodetype, nodehm and nodelist', sometimes it returns 'nodelist, nodehm and nodetype'. In the case that the return list is 'nodelist, nodehm and nodetype', the first target table will be 'nodelist'. And at this time, the nodelist->{_use_cache} = ON. As mentioned before that the cache for nodelist only includes 'node,groups' columns, and it not gets to the condition to refresh the cache. Then the result is 'nodelist.status=NULL'.
So that means, this issue only happens on Ubuntu. The fix is to turn off {_use_cache} flag in NodeRange handling.
fix
2.10 8232e73
2.9 198d469