[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#8710) mdb_copy wait for writer to complete
- To: openldap-its@OpenLDAP.org
- Subject: Re: (ITS#8710) mdb_copy wait for writer to complete
- From: hyc@symas.com
- Date: Sat, 12 Aug 2017 02:04:32 +0000
- Auto-submitted: auto-generated (OpenLDAP-ITS)
muthukumardce@gmail.com wrote:
> Full_Name: Muthukumar
> Version: LMDB 0.82
> OS: OSX
> URL: ftp://ftp.openldap.org/incoming/
> Submission from: (NULL) (49.207.184.177)
>
>
> # Writer
>
> ```
> import lmdb
>
> db_path = "test.db"
> DB_MAX_SIZE = 40 * 1000 * 1000 * 1000
> env = lmdb.Environment(db_path, DB_MAX_SIZE, sync=True)
> txn = env.begin(write=True, buffers=True)
> for i in xrange(5000000):
> value = "*" * 100
> txn.put("i="+str(i), value)
> txn.commit()
> ```
>
> I ran the above python program in my machine which took almost 8 secs to
> complete. Simultaneously i try to copy the database using mdb_copy, but it
> started copying only after the write program completes its execution.
>
> Please note: First i run the writer program then the mdb_copy, if i start
> mdb_copy first it runs smoothly.
>
> Please help.
The ITS is for bug reports, not help requests. Use the openldap-technical
mailing list for assistance.
The mdb_copy program needs to acquire the DB write mutex before executing, to
ensure it gets a consistent snapshot. It obviously can't do that until any
other active writer finishes.
Closing this ITS.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/