Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bad state of multi btree database file after large inserts #40482

Closed
elerionelrond mannequin opened this issue Jun 30, 2004 · 3 comments
Closed

Bad state of multi btree database file after large inserts #40482

elerionelrond mannequin opened this issue Jun 30, 2004 · 3 comments
Labels
extension-modules C modules in the Modules dir

Comments

@elerionelrond
Copy link
Mannequin

elerionelrond mannequin commented Jun 30, 2004

BPO 982679
Nosy @loewis
Files
  • testdb.py: Script to reproduce the bug
  • bsddb_testrun.txt: Output of running bsddb test suite
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2004-07-13.03:36:20.000>
    created_at = <Date 2004-06-30.11:11:17.000>
    labels = ['extension-modules', 'invalid']
    title = 'Bad state of multi btree database file after large inserts'
    updated_at = <Date 2004-07-13.03:36:20.000>
    user = 'https://bugs.python.org/elerionelrond'

    bugs.python.org fields:

    activity = <Date 2004-07-13.03:36:20.000>
    actor = 'loewis'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2004-06-30.11:11:17.000>
    creator = 'elerionelrond'
    dependencies = []
    files = ['1324', '1325']
    hgrepos = []
    issue_num = 982679
    keywords = []
    message_count = 3.0
    messages = ['21358', '21359', '21360']
    nosy_count = 3.0
    nosy_names = ['loewis', 'elerionelrond', 'mmangino']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue982679'
    versions = ['Python 2.3']

    @elerionelrond
    Copy link
    Mannequin Author

    elerionelrond mannequin commented Jun 30, 2004

    The database on file is left in an bad state after
    inserting a large number of entries at once in a BTREE
    database. This happens when: a) multiple databases are
    open in a file, b) the dbtype is DB_BTREE, c) a large
    volume of key + data is inserted in the database. The
    volume varies with the pagesize of the database. No
    error is raised on insertion. However, if we check the
    database file after insertion, we get the following
    error: (-30980, 'DB_VERIFY_BAD: Database verification
    failed -- Subdatabase entry references page 4 of
    invalid type 5'). Moreover, running the test suite from
    bsddb module yields 6 failures and 2 errors (see the
    'bsddb_testrun.txt' attachment). The error condition
    can be verified easily with the 'testdb.py' script -
    see attachments). It was run with Python 2.3.3 and
    2.3.4 on Windows XP, also with Python 2.3.4 the cygwin
    version and Python 2.3+ on Suse Linux 9.0.

    @elerionelrond elerionelrond mannequin closed this as completed Jun 30, 2004
    @elerionelrond elerionelrond mannequin added invalid extension-modules C modules in the Modules dir labels Jun 30, 2004
    @elerionelrond elerionelrond mannequin closed this as completed Jun 30, 2004
    @elerionelrond elerionelrond mannequin added invalid extension-modules C modules in the Modules dir labels Jun 30, 2004
    @mmangino
    Copy link
    Mannequin

    mmangino mannequin commented Jul 12, 2004

    Logged In: YES
    user_id=74879

    This happens when you open multiple databases inside a
    single file without creating a database environment. With
    the following code, your sample works.

    import bsddb.db as db
                                                               
                        
    file = "test.db"
    dbenv=db.DBEnv()
    dbenv.open(None,db.DB_CREATE|db.DB_INIT_MPOOL)
    DB = db.DB(dbenv)
    DB1 = db.DB(dbenv)
    DB.open(file, "one", db.DB_BTREE, db.DB_CREATE)
    DB1.open(file, "two", db.DB_BTREE, db.DB_CREATE)
                                                               
                        
    for i in range(10000):
        DB[str(i)] = "1234567890123456"
                                                               
                        
    DB.sync()
    DB.close()
    DB1.sync()
    DB1.close()
                                                               
                        
    db.DB().verify(file)

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Jul 13, 2004

    Logged In: YES
    user_id=21627

    As mmangino says, this is not a bug, so closing it.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 9, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    0 participants