473,765 Members | 2,058 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Anybody using DB2 9 on Linux x86, please, examine...

I'm almost sure I've found bad bug, but for a while I can't neither confirm nor reject this.

If anybody could make an independent test on it's own system, I'd appreciate it very much.

The possible bug is:

*************** *
*** DB2 refuses DEVICE containers bigger than 4Gb. ***
*************** *

DB2 version affected ( at least ):

| # db2level
| DB21085I Instance "dbi" uses "32" bits and DB2 code release "SQL09012" with level identifier "01030107".
| Informational tokens are "DB2 v9.1.0.2", "s070210", "MI00183", and Fix Pack "2".

The test is rather simple: just try in any database

| # db2 create tablespace X pagesize 4096 managed by database using ( device '/some/device' 1048576 )

The device must be bigger than 4G, and amount of pages indicated to DB2: any number >= 1048576 and <= (device size). The 1048576 because 1048576 * 4096 = 0x100000000, that is 4G.

If you get in response:
| SQL1422N The size of the container is invalid. SQLSTATE=54039

then you are affected too.
--
Konstantin Andreev.
May 30 '07 #1
15 2871
Which part of:
"...it will be fixed in the next fixpack of DB2 9."
from Haider's post was unsatisfying?
DB2 Development is not in the habit of refusing fixes by blaming the OS.
There will be a fix (period).

Cheers
Serge

--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab
May 30 '07 #2
Serge Rielau wrote:
Which part of: "...it will be fixed in the next fixpack of DB2 9." from Haider's post was unsatisfying?
It was not clear that Haider and I discussed the same bug: "...a similar problem was found ...". Haider blamed the broken BLKGETSIZE64 ioctl() call, whereas it's obvious for me, that ioctl is correct. *Nobody* had confirmed the issue I introduced in that thread, so I decided to raise wider testing.

After your confirmation this testing becomes excessive.
Thank you.
--
Konstantin Andreev.
May 31 '07 #3
Konstantin Andreev wrote:
I'm almost sure I've found bad bug, but for a while I can't neither
confirm nor reject this.

If anybody could make an independent test on it's own system, I'd
appreciate it very much.
I have confirmed this and posted reply in your previous thread at 18:32
- an *one hour* before you posted this continuation of your saga.

What else do you want?

APAR? the open Apar is LI71236.

Line numbers of line code changed?

If three people are telling you that it will be fixed in DB2 (not Linux)
upcoming Fix Pack 3 - may be you can accept fact that it *will be* fixed
in FP3.

Any further alarming news will have to be assumed to be bad taste trolling.
Jan M. Nelken

May 31 '07 #4

Actually - if you *do need* solution before FP3 is available, I can make
special build containing patch which fixes this issue available to you.

From what I can see now - it appears that a solution implemented was to
work around incorrect answers received from ioctl BLKGETSIZE64 - as
Haider indicated.

Solution was to code a work around this issue - this is a fix for which
a special build based on Fixpack 2 can be made available to you - and
which most likely will be coded in FP3.
Jan M. Nelken
May 31 '07 #5
Jan M. Nelken wrote:
>
Actually - if you *do need* solution before FP3 is available, I can make
special build containing patch which fixes this issue available to you.

From what I can see now - it appears that a solution implemented was to
work around incorrect answers received from ioctl BLKGETSIZE64 - as
Haider indicated.

Solution was to code a work around this issue - this is a fix for which
a special build based on Fixpack 2 can be made available to you - and
which most likely will be coded in FP3.
Jan M. Nelken
I guess there are a number of simple workarounds -

1) Use file based containers (just allocated the device as a file system and
then creating the tablespace on it). This works for me -

db2inst1@mahler :~/db2datadb2 "create tablespace sairbig1 managed by
database using (file '/home/db2inst1/db2data/test/part0001' 2000000)"
DB20000I The SQL command completed successfully.

2) Use compression, if not already doing so, to limit the size requirement

3) Use automatic storage (which is virtually equivalent to 1).

4) Use multiple smaller containers

5) Use partitioning (which is almost equivalent to 4).

I guess that the fact it has been so long before this was noticed means one
of a number of things -

a) Virtually nobody is using raw devices any more (and IMHO in most cases
any gain in performance is now so small that it is only justified in a very
small number of cases)

b) Nobody on Linux is creating that amount of data (I know that isn't true)

c) Everybody is using x86_64 Linux for servers rather than x86

Phil
May 31 '07 #6
Hello, Jan. You wrote:
>I'm almost sure I've found bad bug, but for a while I can't neither confirm nor reject this.
If anybody could make an independent test on it's own system, I'd appreciate it very much.

I have confirmed this and posted reply in your previous thread at 18:32 - an *one hour* before you posted this continuation of your saga
Maybe, I wouldn't start a new thread if I caught your reply on time.
What else do you want?
I want to hear either of two clear statements:

1) "Yes, DB2 9.1.0.X on Linux x86 is *unable* to use devices containers >=4G, whichever distro you use".
2) "DB2 confirmed to able to use devices >4G on <THATdistro."

If I know a working distro, I just switch to.

From Haider note anyone can conclude: There are distros where the bug appears. So, there are distros where it doesn't.

From my point of view, this is unlikely (my investigation points to the bug in DB2), but I can be wrong. I'm already tryed 3 (three) different distros (gentoo, rhel, debian), all failed. I can't try all of them. In this situation, nothing wrong asking the community to find the working distro.

However, from this thread I can conclude that statement (1) is near the truth.
Actually - if you *do need* solution before FP3 is available, I can make special build containing patch which fixes this issue available to you..
Thank you for suggestion, but I can work around while FP3 is preparing.
From what I can see now - it appears that a solution implemented was to work around incorrect answers received from ioctl BLKGETSIZE64
This is not developer's conference, but... you blame this ioctl() for incorrectness. Even if so, the bug I introduced here is completely *unrelated* to ioctl. The bug appears when ioctl is definitly correct, and completely pertains to the DB2.
--
Konstantin Andreev.
May 31 '07 #7
Philip Nelson wrote:
I guess there are a number of simple workarounds -
[... skip ...]
I guess that the fact it has been so long before this was noticed means one of a number of things -

a) Virtually nobody is using raw devices any more (and IMHO in most cases any gain in performance is now so small that it is only justified in a very small number of cases)
b) Nobody on Linux is creating that amount of data (I know that isn't true)
c) Everybody is using x86_64 Linux for servers rather than x86
Strongly agree. I could suppose:

d) it's harder to setup a lot of device containers comparing to setup a lot of files.

Say, standard Peoplesoft installation uses about 100 (one hundred) tablespaces! I've spent a time, planning disks subsetting, and hope to get noticeable performance gain. Too bad, If I am wrong...
--
Konstantin Andreev.
May 31 '07 #8
Konstantin Andreev wrote:
Maybe, I wouldn't start a new thread if I caught your reply on time.
Please continue this discussion - if you must - in one thread only.
From my point of view, this is unlikely (my investigation points to the
bug in DB2), but I can be wrong.
We have coded around for ioctl BLKGETSIZE64 incorrect results. This
workaround is available in FP3.

For your convenience I tested ioctl BLKGETSIZE64 results:

--------------------------------------------------------------------
[root@os2rules ~]# fdisk -l

Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1 8001 a OS/2 Boot Manager
/dev/hda2 2 260 2080386 6 FAT16
/dev/hda3 261 4866 36997695 f W95 Ext'd (LBA)
/dev/hda5 261 1569 10514511 7 HPFS/NTFS
/dev/hda6 1570 1763 1558273+ 82 Linux swap / Solaris
/dev/hda7 1764 4866 24924816 83 Linux
[root@os2rules ~]# /home/db2admin/GetDevSize /dev/hda1
BLKGETSIZE64: Device /dev/hda1: rc=0 - 8193024 sectors, 2000 4K pages
[root@os2rules ~]# /home/db2admin/GetDevSize /dev/hda2
BLKGETSIZE64: Device /dev/hda2: rc=0 - 2130315264 sectors, 520096 4K pages
[root@os2rules ~]# /home/db2admin/GetDevSize /dev/hda3
BLKGETSIZE64: Device /dev/hda3: rc=0 - 1024 sectors, 0 4K pages
[root@os2rules ~]# /home/db2admin/GetDevSize /dev/hda5
BLKGETSIZE64: Device /dev/hda5: rc=0 - 2176924672 sectors, 531475 4K pages
[root@os2rules ~]# /home/db2admin/GetDevSize /dev/hda6
BLKGETSIZE64: Device /dev/hda6: rc=0 - 1595672064 sectors, 389568 4K pages
[root@os2rules ~]# /home/db2admin/GetDevSize /dev/hda7
BLKGETSIZE64: Device /dev/hda7: rc=0 - 4048175104 sectors, 988324 4K pages
[root@os2rules ~]#
--------------------------------------------------------------------

As you can see - number of sectors returned is wrong in all cases.
There are no DB2 functions in test program which I am enclosing here as
well:
-----------------------------------------------------------------------
/* Compile with "g++ -o GetDevSize -D_FILE_OFFSET_B ITS=64 GetDevSize.c" */

#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <sys/statvfs.h>
#include <sys/param.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include <errno.h>
#include <getopt.h>

#define BLKGETSIZE64 _IOR(0x12,114,s ize_t)
#define BLKGETSIZE _IO(0x12, 96)

int main (int argc, char *argv[])
{
int fh;
int rc;
size_t sectors = 0;
int pagesize = 4;
char *device = NULL;

if (argc < 2)
{
printf("\nSynta x: GetDevSize <device>\n\n" );
rc = -1;
return rc;
}

device = argv[1];

fh = open(device, O_RDONLY | O_DIRECT | O_LARGEFILE , 0600);
if ( -1 == fh )
{
printf("Error opening device \"%s\": %x\n", device, errno);

1,1 Top
-----------------------------------------------------------------------

Jan M. Nelken
Jun 1 '07 #9
Jan M. Nelken wrote:
> From my point of view, this is unlikely (my investigation points to the bug in DB2), but I can be wrong.

For your convenience I tested ioctl BLKGETSIZE64 results:
As you can see - number of sectors returned is wrong in all cases.
LOL
(fdisk Blocks: 8001) BLKGETSIZE64: /dev/hda1: 8193024 sectors
CORRECT
(fdisk Blocks: 2080386) BLKGETSIZE64: /dev/hda2: 2130315264 sectors
CORRECT
(fdisk Blocks: 36997695) BLKGETSIZE64: /dev/hda3: 1024 sectors
WRONG
(fdisk Blocks: 10514511) BLKGETSIZE64: /dev/hda5: 2176924672 sectors
WRONG
(fdisk Blocks: 1558273+) BLKGETSIZE64: /dev/hda6: 1595672064 sectors
CORRECT
(fdisk Blocks: 24924816) BLKGETSIZE64: /dev/hda7: 4048175104 sectors
WRONG

I see 3 correct results, and 3 wrong results. But it's likely something wrong in your code, not in ioctl(), because you mistakenly count BYTES returned by ioctl(BLKGETSIZ E64) as SECTORS.

I can not review your code, because it's omitted, but you could try this (see below) code instead (really, anyone invited to). I've never seen incorrect results from it.
--
Konstantin Andreev.

--( tests )-----------------------------------
root@life dev# fdisk -l /dev/hda

Disk /dev/hda: 16 heads, 63 sectors, 19386 cylinders
Units = cylinders of 1008 * 512 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 18966 9558643+ 83 Linux
/dev/hda2 18966 19380 208845 82 Linux swap

root@life dev# ./chkdev /dev/hda{,1,2}
/dev/hda: ior: (0,0) blocks: 19541088 (of 512) bytes: 10005037056 (0x25458c000) 4K pages: 2442636
/dev/hda1: ior: (0,0) blocks: 19117287 (of 512) bytes: 9788050944 (0x24769ce00) 4K pages: 2389660(+ 3584 bytes)
/dev/hda2: ior: (0,0) blocks: 417690 (of 512) bytes: 213857280 (0xcbf3400) 4K pages: 52211(+ 1024 bytes)

avalon db2 # blockdev --getsize /dev/xd{1,2,3}
234441648
234441648
781422768

avalon db2 # ./chkdev /dev/xd{1,2,3}
/dev/xd1: ior: (0,0) blocks: 234441648 (of 512) bytes: 120034123776 (0x1bf2976000) 4K pages: 29305206
/dev/xd2: ior: (0,0) blocks: 234441648 (of 512) bytes: 120034123776 (0x1bf2976000) 4K pages: 29305206
/dev/xd3: ior: (0,0) blocks: 781422768 (of 512) bytes: 400088457216 (0x5d27216000) 4K pages: 97677846

avalon db2 # echo "0 8388616 linear /dev/xd1 48297272" | dmsetup create foo
avalon db2 # ./chkdev /dev/mapper/foo
/dev/mapper/foo: ior: (0,0) blocks: 8388616 (of 512) bytes: 4294971392 (0x100001000) 4K pages: 1048577

root@life dev# uname -a
Linux life 2.6.17.6lf39 #5 PREEMPT Thu Jul 20 15:47:40 MSD 2006 i686 i686 i386 GNU/Linux

avalon db2 # uname -a
Linux avalon 2.6.21.1-av11 #6 SMP PREEMPT Thu May 10 22:12:16 MSD 2007 i686 Intel(R) Pentium(R) 4 CPU 3.20GHz GenuineIntel GNU/Linux

--( source )-----------------------------------
/* Compile with "gcc -Wall chkdev.c -o chkdev" */
#define _GNU_SOURCE

#include <fcntl.h>
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
#include <string.h>
#include <stdarg.h>
#include <sys/ioctl.h>
#include <stdint.h>

#define BLKGETSIZE _IO(0x12,96)
#define BLKGETSIZE64 0x80041272
#define PAGESIZE 4096

void libcerr( const char *format, ... );
const char *myname = NULL;

int main( int argc, char *argv[] ) {
int io1, io2, fd, j;

uint32_t blocks;
uint64_t bytes;

myname = basename( argv[0] );

for( j = 1; j < argc; ++ j ) {
fd = open( argv[j], O_RDONLY|O_DIRE CT|O_LARGEFILE| O_NONBLOCK );
if( fd < 0 ) {
libcerr( "open(%s)", argv[j] );
continue;
}
io1 = ioctl( fd, BLKGETSIZE, & blocks );
io2 = ioctl( fd, BLKGETSIZE64, & bytes );
if( io1 == -1 )
libcerr( "ioctl(%s,BLKGE TSIZE)", argv[j] );
if( io2 == -1 )
libcerr( "ioctl(%s,BLKGE TSIZE64)", argv[j] );
close( fd );

// ***** print results *****
printf( "%s: ior: (%i,%i)", argv[j], io1, io2 );

if( io1 != -1 ) {
printf( " blocks: %u", blocks );
if( io2 != -1 )
printf( " (of %llu)", bytes / blocks );
}

if( io2 != -1 ) {
printf( " bytes: %llu (0x%llx) 4K pages: %llu",
bytes, bytes, bytes / PAGESIZE );
if( 0 != (bytes %= PAGESIZE) )
printf( "(+ %u bytes)", (unsigned)bytes );
}

putc( '\n', stdout );
} // next device
return 0;
}

void libcerr( const char *format, ... ) {
va_list v;
fwrite( myname, 1, strlen(myname), stderr );
fwrite( ": ", 1, 2, stderr );
va_start( v, format );
vfprintf( stderr, format, v );
va_end( v );
fprintf( stderr, ": [%i] %s.\n", errno, strerror( errno ));
}
--( end )-----------------------------------
Jun 1 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5242
by: Fred | last post by:
Hi, I'm thinking about using a USB attached device for some data collection. I can use other languages to "talk" with it, but I'd prefer a Java solution. Does anybody have any experience with USB and Java and could point me to a starting point? Thanks. (Already know Java and apologize if I'm overlooking the obvious.)
1
2667
by: Nick Leeson | last post by:
I have two HTML files - call it file1.html and file2.html.Is there a utility in Linux that I can use to visually compare the difference between the two files.Please note that I need to display and examine the difference in a Web browser like Mozilla. Otherwise I could have used the simple 'diff' utility. I know a utility called DiffnMerge exists in Windows , but is there something similar for linux? Please lemme know,
3
1450
by: Clamps | last post by:
I was wondering if anybody gets similar results when attempting to query an XML Doc with an XPath query or if this is expected behavior or if I'm using something incorrectly. <xml ...> <LoginInfo> <user> <username>test</username> <password>test</password> </user>
3
5128
by: mairhtin o'feannag | last post by:
Hello, Since DB2 Cluster Certification Guide is out of print and I cannot seem to get my hands on a copy, is there a publication that would give me a "cookbook" approach to setting up a cluster using Linux and multiple machines? I came across a couple of things, but they all assume one honking great AIX box with multiple SPs and that sort of thing.
27
4767
by: MK | last post by:
I am a newbie. Please help. The following warning is issued by gcc-3.2.2 compiler (pc Linux): ================================================================== read_raw_data.c:51: warning: assignment makes pointer from integer without a cast ================================================================== when the following piece of code was compiled. The offending statement is calloc. A similar statement in the main() function...
1
1086
by: CrazyCube | last post by:
does any body got some files about Orthogonal Experiment?? i really need it now ,if anybody got ,please send them to me my mailbox is : yuxh312@hotmail.com
18
26120
by: Digital Puer | last post by:
Hi, I'm coming over from Java to C++, so please bear with me. In C++, is there a way for me to use exceptions to catch segmentation faults (e.g. when I access a location off the end of an array)? Thanks.
5
2474
by: John Ladasky | last post by:
Hi folks, Running Python 2.5 on both a Windows XP laptop, and an Ubuntu Linux 7.04 desktop. I've gotten tired of maintaining multiple copies of my personal modules that I use over and over. I have copies of these files in the same directory as the main program I happen to be working on at the time. I've also downloaded FANN, and want to use its Python bindings. FANN does not seem to build automatically, like wxWidgets
44
584
by: John Dann | last post by:
I'm unclear as to how best to use what I'm terming the top-level CSS selectors, by which I mean selectors like *, html and body. I'm coming at this from trying to understand how best to set font sizes but I seem to have strayed into a broader question. Some CSS guides seem to suggest that a * declaration is good practice for any style sheet, primarily I suppose to set zero defaults for margin and padding for all other relevant selectors...
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9835
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5276
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.