Make flush_writes the default. Change option to 'dbcachenowsync'.

Change backend struct option to li_dbcachewsync.
This commit is contained in:
Kurt Zeilenga 1998-11-07 02:25:32 +00:00
parent f67adafb44
commit 3f1b97481c
7 changed files with 14 additions and 7 deletions

View file

@ -266,6 +266,10 @@ by the LDBM backend database instance. The default is 1000 entries.
Specify the size in bytes of the in-memory cache associated
with each open index file. If not supported by the underlying database
method, this option is ignored without comment. The default is 100000 bytes.
.B dbcachenowsync
Specify that database writes should not be immediately synchronized
with in memory changes. Enabling this option may improving performance
at the expense of data security.
.TP
.B directory <directory>
Specify the directory where the LDBM files containing the database and

View file

@ -110,7 +110,7 @@ struct ldbminfo {
struct cache li_cache;
Avlnode *li_attrs;
int li_dbcachesize;
int li_flush_wrt;
int li_dbcachewsync;
struct dbcache li_dbcache[MAXDBCACHE];
pthread_mutex_t li_dbcache_mutex;
pthread_cond_t li_dbcache_cv;

View file

@ -80,9 +80,9 @@ ldbm_back_config(
}
li->li_dbcachesize = atoi( argv[1] );
/* flush on writes */
} else if ( strcasecmp( argv[0], "flushwrites" ) == 0 ) {
li->li_flush_wrt = 1;
/* no write sync */
} else if ( strcasecmp( argv[0], "dbcachenowsync" ) == 0 ) {
li->li_dbcachewsync = 0;
/* anything else */
} else {

View file

@ -50,7 +50,7 @@ dn2id_add(
data.dsize = sizeof(ID);
flags = LDBM_INSERT;
if ( li->li_flush_wrt ) flags |= LDBM_SYNC;
if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
rc = ldbm_cache_store( db, key, data, flags );

View file

@ -48,7 +48,7 @@ id2entry_add( Backend *be, Entry *e )
/* store it */
flags = LDBM_REPLACE;
if ( li->li_flush_wrt ) flags |= LDBM_SYNC;
if ( li->li_dbcachewsync ) flags |= LDBM_SYNC;
rc = ldbm_cache_store( db, key, data, flags );
pthread_mutex_unlock( &entry2str_mutex );

View file

@ -195,7 +195,7 @@ idl_store(
#endif
flags = LDBM_REPLACE;
if( li->li_flush_wrt ) flags |= LDBM_SYNC;
if( li->li_dbcachewsync ) flags = LDBM_SYNC;
rc = ldbm_cache_store( db, key, data, flags );
/* Debug( LDAP_DEBUG_TRACE, "<= idl_store %d\n", rc, 0, 0 ); */

View file

@ -34,6 +34,9 @@ ldbm_back_init(
/* default database cache size */
li->li_dbcachesize = DEFAULT_DBCACHE_SIZE;
/* default cache mode is sync on write */
li->li_dbcachewsync = 1;
/* default file creation mode */
li->li_mode = DEFAULT_MODE;