Bug 768886 - RfE run "vacuum full" after bundle deletion
Summary: RfE run "vacuum full" after bundle deletion
Keywords:
Status: NEW
Alias: None
Product: RHQ Project
Classification: Other
Component: Core Server
Version: 4.2
Hardware: Unspecified
OS: Unspecified
medium
unspecified
Target Milestone: ---
: ---
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-12-19 10:15 UTC by Heiko W. Rupp
Modified: 2022-03-31 04:27 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)

Description Heiko W. Rupp 2011-12-19 10:15:47 UTC
> I previously then asked how the actual bits of the bundles are cleaned
> (or are they), because the database size on disk keeps growing
> constantly. I was then informed that vacuuming should release the actual
> disk space.

When you update or delete a row in postgres, this row is marked as invalid and in
case of update a new row is appended.

Now vacuum with the standard options is going through the table and finding all
those rows that are marked as invalid and is setting them to "fresh" so that subsequent
inserts can re-use those rows so that the table size is indeed not growing indefinitely.

So what you were seeing here is that a pure vacuum (which runs automatically
in postgres when certain assumptions are met and which the JBossON server is
running in default settings every hour) is just going through the database and is 
marking those rows as fresh. It does not try to compact any database files.

There is an option 'full' to vacuum that tries indeed to reclaim the disk space
of the unused rows. This option is not enabled by default, because 
- it acquires an exclusive lock on the table and thus prevents access by the JBossON server
- in cases where there will be new rows added immediately, shrinking the file (that backs a table) 
 and extending it directly afterwards is more expensive than just re-using the file.

So what you can do it to manually trigger a "vacuum full" on the database when there is no load
(or only on the bundle tables, when you know noone is accessing them).


-----

The new operation vacuum_full  would be by default for postgres and a no-op for other databases - until we find out how we can help them how to reclaim the space.

Comment 1 Charles Crouch 2012-02-14 03:22:46 UTC
Putting this as a "soft" target for 3.1
We can see if there are some procedures that can be determined to help alleviate the issue of "empty" table bloat, e.g. create a lot bundles, delete them all, DB size doesn't decrease.
e.g.
1) Put all JON servers in maintenance mode
2) Push the "do a full vacuum on content/bundle tables". 
3) Wait for success message
3) Put all JON servers in normal mode

Comment 2 Mike Foley 2012-02-27 17:13:08 UTC
triage 2/27/2012 mfoley, asantos, crouch, loleary


Note You need to log in before you can comment on or make changes to this bug.