![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello, We are using Berkley DB 4.0.14, and running four independent processes (written in C), accessing one shared index file. The first process to start creates and opens an environment and uses a file to notify all following processes that they need to join the environment, and not to create it. |
|
The index file is opened in the environment by each process, with read/write access. To read, we use simple "get" function, to write we use transactions. |
#3
| |||
| |||
|
|
We are using Berkley DB 4.0.14, and running four independent processes (written in C), accessing one shared index file. The first process to start creates and opens an environment and uses a file to notify all following processes that they need to join the environment, and not to create it. The index file is opened in the environment by each process, with read/write access. To read, we use simple "get" function, to write we use transactions. |
#4
| |||
| |||
|
|
The index file is opened in the environment by each process, with read/write access. To read, we use simple "get" function, to write we use transactions. I doubt that can work. If you're going to use transactions, you'll have to use transactions for everything, including read accesses. Otherwise odds are the DB content changes under the feet of an ongoing read access. |
#5
| |||
| |||
|
|
olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309151240.28a759a7 (AT) posting (DOT) google.com>... Hi, my name is Keith Bostic and I'm with Sleepycat Software. We are using Berkley DB 4.0.14, and running four independent processes (written in C), accessing one shared index file. The first process to start creates and opens an environment and uses a file to notify all following processes that they need to join the environment, and not to create it. The index file is opened in the environment by each process, with read/write access. To read, we use simple "get" function, to write we use transactions. Berkeley DB can absolutely support this architecture. Can you post your test program? |
B_DUP");
|
Regards, --keith =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Keith Bostic bostic (AT) sleepycat (DOT) com Sleepycat Software Inc. keithbosticim (ymsgid) 118 Tower Rd. +1-781-259-3139 Lincoln, MA 01773 http://www.sleepycat.com |
#6
| |||
| |||
|
|
bostic (AT) sleepycat (DOT) com (Keith Bostic) wrote in message news:<adecb6f.0309160454.6c1c511f (AT) posting (DOT) google.com>... olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309151240.28a759a7 (AT) posting (DOT) google.com>... If that same program is started in another session, and ANOTHER key is passed as a parameter (which should prevent both processes from conflicting, right?), one or both programs crash, but by looking at the output its clear that before the crash they both updated appropriate keys and even saw changes made by each other. |
#7
| |||
| |||
|
|
olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309161227.725ed6a9 (AT) posting (DOT) google.com>... bostic (AT) sleepycat (DOT) com (Keith Bostic) wrote in message news:<adecb6f.0309160454.6c1c511f (AT) posting (DOT) google.com>... olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309151240.28a759a7 (AT) posting (DOT) google.com>... If that same program is started in another session, and ANOTHER key is passed as a parameter (which should prevent both processes from conflicting, right?), one or both programs crash, but by looking at the output its clear that before the crash they both updated appropriate keys and even saw changes made by each other. You've configured Berkeley DB for locking (DB_INIT_LOCK), so it doesn't matter if the threads of control use a different key or not. With locking configured, access to the database will be serialized. Anyway, I've just run your program with 7 different processes, for about 40,000 iterations, without failure. If you start with a clean database environment directory, and start N copies of the program, how long does it take for you to reproduce the failure? Are you ever interrupting the program and restarting it before the failures occur? Can you please send me a stack trace from one of the crashes? With what hardware and operating system are you running your tests? |
|
Regards, --keith =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Keith Bostic bostic (AT) sleepycat (DOT) com Sleepycat Software Inc. keithbosticim (ymsgid) 118 Tower Rd. +1-781-259-3139 Lincoln, MA 01773 http://www.sleepycat.com |
#8
| |||
| |||
|
|
olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309161227.725ed6a9 (AT) posting (DOT) google.com>... bostic (AT) sleepycat (DOT) com (Keith Bostic) wrote in message news:<adecb6f.0309160454.6c1c511f (AT) posting (DOT) google.com>... olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309151240.28a759a7 (AT) posting (DOT) google.com>... If that same program is started in another session, and ANOTHER key is passed as a parameter (which should prevent both processes from conflicting, right?), one or both programs crash, but by looking at the output its clear that before the crash they both updated appropriate keys and even saw changes made by each other. You've configured Berkeley DB for locking (DB_INIT_LOCK), so it doesn't matter if the threads of control use a different key or not. With locking configured, access to the database will be serialized. Anyway, I've just run your program with 7 different processes, for about 40,000 iterations, without failure. If you start with a clean database environment directory, and start N copies of the program, how long does it take for you to reproduce the failure? Are you ever interrupting the program and restarting it before the failures occur? Can you please send me a stack trace from one of the crashes? In answer to your questions, is there a way I can send you some sample |
|
With what hardware and operating system are you running your tests? |
|
Regards, --keith =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= Keith Bostic bostic (AT) sleepycat (DOT) com Sleepycat Software Inc. keithbosticim (ymsgid) 118 Tower Rd. +1-781-259-3139 Lincoln, MA 01773 http://www.sleepycat.com |
#9
| |||
| |||
|
|
bostic (AT) sleepycat (DOT) com (Keith Bostic) wrote in message news:<adecb6f.0309190635.272e278e (AT) posting (DOT) google.com>... olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309161227.725ed6a9 (AT) posting (DOT) google.com>... bostic (AT) sleepycat (DOT) com (Keith Bostic) wrote in message news:<adecb6f.0309160454.6c1c511f (AT) posting (DOT) google.com>... olga_segal (AT) yahoo (DOT) com (Olga Segal) wrote in message news:<7efcf10b.0309151240.28a759a7 (AT) posting (DOT) google.com>... In answer to your questions, is there a way I can send you some sample output along with different scenarios I ran into during testing? I tried to use bostic (AT) sleepycat (DOT) com, but the message was said to be rejected. |
![]() |
| Thread Tools | |
| Display Modes | |
| |