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
parent
79e9d4faf9
commit
98f82105a0
|
@ -280,6 +280,20 @@ namespace OpenSim.DataStore.MonoSqlite
|
||||||
cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter)));
|
cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter)));
|
||||||
cmd.ExecuteNonQuery();
|
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();
|
conn.Close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue