In the lsm1 extension, lsm_insert(): insert a new key/value pair into the database, overwriting any existing entry with the same key When I tried to test this case (insert existing entry with the same key) the database size increasing without overwriting any existing entry with the same key. The below test c code illustrate the case:

void test(void)
{
	lsm_db *db;
	int rc = lsm_new(0, &db);
	if( rc != LSM_OK )
		return;

	rc = lsm_open(db, "test.lsmdb");
	if( rc != LSM_OK )
		return;

	DWORD Key = 0x12345678;
	char Val_1[] = "12345678";
	char Val_2[] = "ABCDEFGH";

	lsm_begin(db, 1);

	lsm_insert(db, (void *)&Key, sizeof(Key), Val_1, strlen(Val_1)+1);

	below insert should update the same key with a new value
	lsm_insert(db, (void *)&Key, sizeof(Key), Val_2, strlen(Val_2)+1);

	lsm_commit(db, 0);

	lsm_cursor *csr;
	if( lsm_csr_open(db, &csr) != LSM_OK )
		return;

	int seekrc = lsm_csr_seek(csr, &Key, sizeof(Key), LSM_SEEK_EQ);
	int validrc = lsm_csr_valid(csr);
	if( seekrc == LSM_OK && validrc )
	{
		char *pKeyPtr, *pValPtr;
		int nKey, nVal;
		lsm_csr_key(csr, (const void **)&pKeyPtr, &nKey);
		lsm_csr_value(csr, (const void **)&pValPtr, &nVal);

		the below printf will display the old value rather than new updated value
		printf("key = %08X, val = %s\n", pKeyPtr, pValPtr);
	}
	lsm_csr_close(csr);

	lsm_close(db);
}