Bug #30271 NDB_LE_MemoryUsage.page_size_kb returns page size in bytes, not kilobytes
Submitted: 7 Aug 2007 9:33 Modified: 20 Feb 2008 22:02
Reporter: Hartmut Holzgraefe Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: NDB API Severity:S3 (Non-critical)
Version: OS:Any
Assigned to: Guangbao Ni CPU Architecture:Any
Triage: D4 (Minor)

[7 Aug 2007 9:33] Hartmut Holzgraefe
Description:
when catching the NDB_LE_MemoryUsage events created
as response to "ALL DUMP 1000" requests the page size
is reported in a field called page_size_kb. The field
name implies that the page size in kilobytes is returned
(32 for data and 8 for index memory), the actual result
is in bytes though (32768 for data, 8192 for index).

How to repeat:
see attached test program

- change the CONNECT_STRING within mgm_dump1000.cc (default: localhost)
- configure it with "configure --with-mysql=/mysql-prefix"
- build it with "make"
- run it
- issue an "ALL DUMP 1000"
- see the results

Suggested fix:
either rename the field to page_size_bytes instead of page_size_kb
or divide the result value by 1024 before storing it in page_size_kb
[7 Aug 2007 9:38] Hartmut Holzgraefe
test program dumping ALL DUMP 1000 event results

Attachment: mgm_dump1000-0.1.tar.gz (application/x-gunzip, text), 299.45 KiB.

[15 Aug 2007 2: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/32532

ChangeSet@1.2472, 2007-08-15 10:25:54+08:00, gni@dev3-221.dev.cn.tlan +2 -0
  BUG#30271 NDB_LE_MemoryUsage.page_size_kb actually returns page size in bytes, not kilobyte
[17 Aug 2007 4:24] Stewart Smith
ok to push.
[17 Aug 2007 6:40] 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/32684

ChangeSet@1.2474, 2007-08-17 14:32:39+08:00, gni@dev3-221.dev.cn.tlan +2 -0
  BUG#30271 NDB_LE_MemoryUsage.page_size_kb actually returns page size in bytes, not kilobyte
[14 Nov 2007 3:39] Guangbao Ni
push into mysql-5.0-ndb-bj and mysql-5.1-new-ndb-bj
[1 Feb 2008 19:18] Jon Stephens
Documented in the 5.1.23-ndb-6.3.8 changelog as follows:

      
        Because NDB_LE_MemoryUsage.page_size_kb
        shows memory page sizes in bytes rather than kilobytes, it has
        been renamed to page_size_bytes.
        page_size_kb is now deprecated and thus
        subject to removal in a future release, although is currently
        remains supported for reasons of backwards compatibility. See
        -The Ndb_logevent_type Type-, for more information about
        NDB_LE_MemoryUsage.

Left in PQ status pending furhter merges.
[2 Feb 2008 11:11] Jon Stephens
Also documented for 5.1.23-ndb-6.2.11; left bug status unchanged.
[20 Feb 2008 16:02] Bugs System
Pushed into 5.0.58
[20 Feb 2008 16:03] Bugs System
Pushed into 5.1.24-rc
[20 Feb 2008 16:03] Bugs System
Pushed into 6.0.5-alpha
[20 Feb 2008 22:02] Jon Stephens
Also documented for 5.0.58, 5.1.24, and 6.0.5.