| Bug #42505 | Falcon: Record backlogging not enabled by the Scavenger | ||
|---|---|---|---|
| Submitted: | 1 Feb 0:22 | Modified: | 27 Feb 20:24 |
| Reporter: | Christopher Powers | ||
| Status: | Patch queued | ||
| Category: | Server: Falcon | Severity: | S2 (Serious) |
| Version: | 6.0-falcon-team | OS: | Any |
| Assigned to: | Christopher Powers | Target Version: | 6.0.10 |
| Tags: | Memory, scavenger, F_BACKLOG | ||
| Triage: | Triaged: D3 (Medium) | ||
[1 Feb 0:22]
Christopher Powers
[1 Feb 0:25]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/64759 2990 Christopher Powers 2009-01-31 Bug #42505, "Falcon: Record backlogging not enabled by the Scavenger" Fixed several issues with record backlogging.
[2 Feb 7:33]
Kevin Lewis
This patch implements the first two suggested fixes forthis bug. The third suggestion,
turn off backlogging, is not implemented. Chris should decide if this change is complete
or if a new bug should be opened to improve backlogging more.
Note that by comparing 'if (recordScavenge.retiredActiveMemory > recordScavengeFloor)',
this patch uses a moving target. This is because retiredActiveMemory is the actual
memory after the scavenge cycle. This actual memory level went down during the scavenge
while also going up because of new records allocated. It does not necessarily reflect
how successful the scavenge cycle was. In fact, this test will almost always succeed
after the first scavenge cycle that is over the threshold. The cycle will only try to
move the active memory sown to the floor. But if any records are allocated at all,
chances are, retiredActiveMemory will be higher than the floor.
I think the following code should be removed from RecordVersion::retire()
- // Cannot retire this record. Add up remaining space.
-
- recordScavenge->recordsRemaining++;
- recordScavenge->spaceRemaining += getMemUsage();
-
- for (Record *prior = getPriorVersion(); prior; prior = prior->getPriorVersion())
- {
- ++recordScavenge->recordsRemaining;
- recordScavenge->spaceRemaining += prior->getMemUsage();
- }
Then spaceRemaining should be calcuated based on just how much was actually done during
the cycle. Oprofile results have shown a surprising amount of time spent calling
MemMgr::getMemUsage(). The calls above are not needed when it can be calculated as
below.
- recordsRemaining = totalRecords - recordsPruned;
+ recordsRemaining = totalRecords - recordsPruned - recordsRetired;
- spaceRemaining = totalRecordSpace - spacePruned;
+ spaceRemaining = totalRecordSpace - spacePruned - spaceRetired;
If the above is implemented, the following change from the patch will not be needed;
@@ -1816,7 +1816,7 @@ void Database::scavengeRecords(void)
- if (recordScavenge.spaceRemaining > recordScavengeFloor)
+ if (recordScavenge.retiredActiveMemory > recordScavengeFloor)
setLowMemory();
Then the code will be faster, without making a bunch of calls to getMemUsage(), and it
would be more accurate to turn backlogging on.
[3 Feb 3:56]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/64959 2995 Christopher Powers 2009-02-02 Bug #42505 "Falcon: Record backlogging not enabled by the Scavenger" Limit updateCardinalities() to once every 20 scavenge cycles. This function is too expensive to call every scavenge cycle. Made Changes per Kevin's comments in the bug report, with one exception: Database::scavengeRecords() still determines low memory with retiredActiveMemory > recordScavengeFloor. Using spaceRemaining > recordScavengeFloor does not enable backlogging when needed (confirmed against falcon_bug_36294-big.test).
[3 Feb 18:13]
Ann Harrison
There are a number of places in the code that treat the backlog tablespace differently based on its illegal number. Do you really need to change that?
[5 Feb 6:37]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/65282 2999 Christopher Powers 2009-02-04 Bug #42505 "Falcon: Record backlogging not enabled by the Scavenger" Use negative tablespace ids for reserved tablespaces
[5 Feb 7:17]
Kevin Lewis
This solution works to keep the negative tablespaceID for the backlog tablespace that 'other code' relies on. And it has a slot within the hash table. New patch is also approved.
[13 Feb 8:23]
Bugs System
Pushed into 6.0.10-alpha (revid:alik@sun.com-20090211182317-uagkyj01fk30p1f8) (version source revid:christopher.powers@sun.com-20090205053442-3d2okbitpbc5zx1q) (merge vers: 6.0.10-alpha) (pib:6)
