diff options
author | Sean Dague | 2007-11-19 22:59:28 +0000 |
---|---|---|
committer | Sean Dague | 2007-11-19 22:59:28 +0000 |
commit | 98f82105a08d7f317fd2f1f14c438d3d7e3c920f (patch) | |
tree | c2f4cd8fd9558cf8d0192a4b9aa0a6356522ae04 /OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite | |
parent | Tweaked for a possibility of 10 elements. (diff) | |
download | opensim-SC_OLD-98f82105a08d7f317fd2f1f14c438d3d7e3c920f.zip opensim-SC_OLD-98f82105a08d7f317fd2f1f14c438d3d7e3c920f.tar.gz opensim-SC_OLD-98f82105a08d7f317fd2f1f14c438d3d7e3c920f.tar.bz2 opensim-SC_OLD-98f82105a08d7f317fd2f1f14c438d3d7e3c920f.tar.xz |
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.
Diffstat (limited to 'OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite')
-rw-r--r-- | OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs index fc6f59c..b00b734 100644 --- a/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs +++ b/OpenSim/Region/Storage/OpenSim.DataStore.MonoSqlite/MonoSqliteDataStore.cs | |||
@@ -280,6 +280,20 @@ namespace OpenSim.DataStore.MonoSqlite | |||
280 | cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); | 280 | cmd.Parameters.Add(new SqliteParameter(":Heightfield", serializeTerrain(ter))); |
281 | cmd.ExecuteNonQuery(); | 281 | cmd.ExecuteNonQuery(); |
282 | } | 282 | } |
283 | |||
284 | // This is added to get rid of the infinitely growing | ||
285 | // terrain databases which negatively impact on SQLite | ||
286 | // over time. Before reenabling this feature there | ||
287 | // needs to be a limitter put on the number of | ||
288 | // revisions in the database, as this old | ||
289 | // implementation is a DOS attack waiting to happen. | ||
290 | |||
291 | using(SqliteCommand cmd = new SqliteCommand("delete from terrain where RegionUUID=:RegionUUID and Revision < :Revision", conn)) | ||
292 | { | ||
293 | cmd.Parameters.Add(new SqliteParameter(":RegionUUID", regionID.ToString())); | ||
294 | cmd.Parameters.Add(new SqliteParameter(":Revision", revision)); | ||
295 | cmd.ExecuteNonQuery(); | ||
296 | } | ||
283 | conn.Close(); | 297 | conn.Close(); |
284 | } | 298 | } |
285 | } | 299 | } |