Only force prim persistence before delete if the prim is the result of an unpersisted delink
This considerably improves delete performance for objects with large linksetsviewer-2-initial-appearance
parent
5246d98b8d
commit
7e72afcb3e
|
@ -2057,7 +2057,10 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
// Force a database update so that the scene object group ID is accurate. It's possible that the
|
||||
// group has recently been delinked from another group but that this change has not been persisted
|
||||
// to the DB.
|
||||
// This is an expensive thing to do so only do it if absolutely necessary.
|
||||
if (so.HasGroupChangedDueToDelink)
|
||||
ForceSceneObjectBackup(so);
|
||||
|
||||
so.DetachFromBackup();
|
||||
SimulationDataService.RemoveObject(so.UUID, m_regInfo.RegionID);
|
||||
}
|
||||
|
|
|
@ -119,11 +119,20 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
timeFirstChanged = DateTime.Now.Ticks;
|
||||
}
|
||||
m_hasGroupChanged = value;
|
||||
|
||||
// m_log.DebugFormat(
|
||||
// "[SCENE OBJECT GROUP]: HasGroupChanged set to {0} for {1} {2}", m_hasGroupChanged, Name, LocalId);
|
||||
}
|
||||
|
||||
get { return m_hasGroupChanged; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Has the group changed due to an unlink operation? We record this in order to optimize deletion, since
|
||||
/// an unlinked group currently has to be persisted to the database before we can perform an unlink operation.
|
||||
/// </summary>
|
||||
public bool HasGroupChangedDueToDelink { get; private set; }
|
||||
|
||||
private bool isTimeToPersist()
|
||||
{
|
||||
if (IsSelected || IsDeleted || IsAttachment)
|
||||
|
@ -1330,6 +1339,7 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
backup_group.RootPart.AngularVelocity = RootPart.AngularVelocity;
|
||||
backup_group.RootPart.ParticleSystem = RootPart.ParticleSystem;
|
||||
HasGroupChanged = false;
|
||||
HasGroupChangedDueToDelink = false;
|
||||
|
||||
m_scene.EventManager.TriggerOnSceneObjectPreSave(backup_group, this);
|
||||
datastore.StoreObject(backup_group, m_scene.RegionInfo.RegionID);
|
||||
|
@ -2208,8 +2218,9 @@ namespace OpenSim.Region.Framework.Scenes
|
|||
|
||||
linkPart.Rezzed = RootPart.Rezzed;
|
||||
|
||||
//HasGroupChanged = true;
|
||||
//ScheduleGroupForFullUpdate();
|
||||
// When we delete a group, we currently have to force persist to the database if the object id has changed
|
||||
// (since delete works by deleting all rows which have a given object id)
|
||||
objectGroup.HasGroupChangedDueToDelink = true;
|
||||
|
||||
return objectGroup;
|
||||
}
|
||||
|
|
|
@ -121,13 +121,14 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
"Not exactly sure what this is asserting...");
|
||||
|
||||
// Delink part 2
|
||||
grp1.DelinkFromGroup(part2.LocalId);
|
||||
SceneObjectGroup grp3 = grp1.DelinkFromGroup(part2.LocalId);
|
||||
|
||||
if (debugtest)
|
||||
m_log.Debug("Group2: Prim2: OffsetPosition:" + part2.AbsolutePosition + ", OffsetRotation:" + part2.RotationOffset);
|
||||
|
||||
Assert.That(grp1.Parts.Length, Is.EqualTo(1), "Group 1 still contained part2 after delink.");
|
||||
Assert.That(part2.AbsolutePosition == Vector3.Zero, "The absolute position should be zero");
|
||||
Assert.That(grp3.HasGroupChangedDueToDelink, Is.True);
|
||||
}
|
||||
|
||||
[Test]
|
||||
|
@ -333,7 +334,10 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
|||
|
||||
// These changes should occur immediately without waiting for a backup pass
|
||||
SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
|
||||
|
||||
Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True);
|
||||
scene.DeleteSceneObject(groupToDelete, false);
|
||||
Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False);
|
||||
|
||||
List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
|
||||
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
<appender name="Console" type="OpenSim.Framework.Console.OpenSimAppender, OpenSim.Framework.Console">
|
||||
<layout type="log4net.Layout.PatternLayout">
|
||||
<conversionPattern value="%date{HH:mm:ss} - %message" />
|
||||
<!-- console log with milliseconds. Useful for debugging -->
|
||||
<!-- <conversionPattern value="%date{HH:mm:ss.fff} - %message" /> -->
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
|
|
Loading…
Reference in New Issue