mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-09 14:03:20 +09:00
bug updates name index when an object has been deleted
(cherry picked from commit 4c298351d7)
This commit is contained in:
1 parent
5a21a49c7a
commit
8296199bb7
1 file changed
+13
-13
+13
-13
@@ -306,19 +306,6 @@ PoolObjectSQL * PoolSQL::get(const string& name, int ouid, bool olock)
|
||||
}
|
||||
else
|
||||
{
|
||||
objectsql = create();
|
||||
|
||||
rc = objectsql->select(db,name,ouid);
|
||||
|
||||
if ( rc != 0 )
|
||||
{
|
||||
delete objectsql;
|
||||
|
||||
unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( index != name_pool.end() && index->second->isValid() == false )
|
||||
{
|
||||
index->second->lock();
|
||||
@@ -332,6 +319,19 @@ PoolObjectSQL * PoolSQL::get(const string& name, int ouid, bool olock)
|
||||
delete tmp_ptr;
|
||||
}
|
||||
|
||||
objectsql = create();
|
||||
|
||||
rc = objectsql->select(db,name,ouid);
|
||||
|
||||
if ( rc != 0 )
|
||||
{
|
||||
delete objectsql;
|
||||
|
||||
unlock();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
string okey = key(objectsql->name,objectsql->uid);
|
||||
|
||||
pool.insert(make_pair(objectsql->oid, objectsql));
|
||||
|
||||
Reference in new issue
Block a user