put in changes to only keep the last terrain revision. The current

unbounded model causes performance and filesystem filling grief.
Before enabling this again, we need a reasonable bounding model.
afrisby
Sean Dague 2007-11-19 22:59:28 +00:00
parent 79e9d4faf9
commit 98f82105a0
1 changed files with 14 additions and 0 deletions

View File

@ -280,6 +280,20 @@ namespace OpenSim.DataStore.MonoSqlite
cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter)));
cmd.ExecuteNonQuery();
}
// This is added to get rid of the infinitely growing
// terrain databases which negatively impact on SQLite
// over time. Before reenabling this feature there
// needs to be a limitter put on the number of
// revisions in the database, as this old
// implementation is a DOS attack waiting to happen.
using(SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision < :Revision", conn))
{
cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString()));
cmd.Parameters.Add(new SqliteParameter(":Revision", revision));
cmd.ExecuteNonQuery();
}
conn.Close();
}
}