Bug #21345 Error in cluster logfile rotation
Submitted: 30 Jul 2006 0:02 Modified: 2 Nov 2006 8:20
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Cluster (NDB) storage engine Severity:S3 (Non-critical)
Version:4.1, 5.0, 5,1 OS:Any (*)
Assigned to: david li CPU Architecture:Any
Tags: cluster log

[30 Jul 2006 0:02] Hartmut Holzgraefe
Description:
Cluster logs are renamed like this when the main log file exceeds the configured max. size:

ndb_1_cluster.log.1
ndb_1_cluster.log.2
ndb_1_cluster.log.3
ndb_1_cluster.log.4
ndb_1_cluster.log.5
ndb_1_cluster.log.1
ndb_1_cluster.log.1
ndb_1_cluster.log.1
...

so it wraps over from .5 to .1 but then stays with .1 forever so that in the long run there is always just one log generation, the additional rotated log files are never reused again

How to repeat:
Lower the log file size, e.g. using

  LogDestination=FILE:filename=ndb_1_cluster.log,maxsize=1000,maxfiles=6

let the cluster run for a while, then check the file creation dates and the log file contents

Suggested fix:
Fix the rotation code in ./ndb/src/common/logger/FileLogHandler.cpp,
function FileLogHandler::createNewFile()
[1 Sep 2006 7:33] 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/11227

ChangeSet@1.2533, 2006-09-01 15:32:40+08:00, dli@dev3-76.dev.cn.tlan +3 -0
  Fix for BUG#21345, Error in cluster logfile rotation.
  Fixed the cluster logfile rotation code, let the cluster logfile be renamed correctly when the main logfile exceeds the configured maximum size.
[10 Oct 2006 18:38] Jonas Oreland
pushed into 5.1.12
[1 Nov 2006 14:26] Jonas Oreland
pushed into 4.1.22
[1 Nov 2006 14:42] Jonas Oreland
pushed into 5.0.29
[2 Nov 2006 8:20] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix for 4.1.22/5.0.29/5.1.12.
[4 Nov 2006 3:20] Jon Stephens
*Fix for 5.0 documented in 5.0.30 Release Notes.*
[4 Jan 2007 13:29] 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/17625