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

Manual compaction returns error if auto-compact is already running #1192

Closed
ashvindersingh opened this issue Apr 1, 2016 · 4 comments
Closed
Milestone

Comments

@ashvindersingh
Copy link

Found on build 1.2.1-10
Sync Gateway: 1.2.1.4
Using Mac OS-X (el-capitan) liteserv client

Steps:

export STORAGE=ForestDB
export SYNCGATE_PATH=/your/path/to/bin/sync_gateway
export LITESERV_PATH=/your/path/to/couchbase-lite-macosx-enterprise_1.2.1-10/LiteServ
  • Run script from sync-gateway-tests as follows:
node tests/cbl-database.js

Test script line: https://github.com/couchbaselabs/sync-gateway-tests/blob/master/tests/cbl-database.js#L217

Get the following warnings:
https://gist.github.com/ashvindersingh/f884882f8fb7595da79304aae5409541#file-forestdb_cbl_database-js-logs-L42

https://gist.github.com/ashvindersingh/f884882f8fb7595da79304aae5409541#file-forestdb_cbl_database-js-logs-L72

@snej
Copy link
Contributor

snej commented Apr 1, 2016

Manual compaction isn't necessary with ForestDB, but of course it should still work. The error is WARNING: ForestDB error: file handle is busy (-23) — it may be that fdb_compact doesn't work if there are multiple handles open on the database. I'll ask.

@snej
Copy link
Contributor

snej commented Apr 1, 2016

Aha, here's a note from the doc-comment for fdb_compact:

 * Also note that if a given ForestDB file is currently being compacted by the
 * compaction daemon, then FDB_RESULT_FILE_IS_BUSY is returned to the caller.

So it sounds like ForestDB's auto-compact was already in progress when the manual compact was requested.

To fix this, we can either (a) ignore that error code, or (b) handle it by waiting for the background compaction to complete before returning.

@snej snej changed the title Multiple warnings when doing compaction with ForestDB storage-engine Manual compaction returns error if auto-compact is already running Apr 1, 2016
@snej snej added this to the 1.3 milestone Apr 1, 2016
@snej
Copy link
Contributor

snej commented Apr 1, 2016

(To be specific, this should be fixed in CBForest itself.)

snej added a commit that referenced this issue Apr 1, 2016
-compact shouldn't return an error if it's called while there's
already a background auto-compact in progress.

Fixes #1192
@snej
Copy link
Contributor

snej commented Apr 1, 2016

Merged to dev branch; closing.

@snej snej closed this as completed Apr 1, 2016
snej added a commit that referenced this issue Apr 4, 2016
* Database::compact shouldn't return an error if it's called while there's
already a background auto-compact in progress. (#1192)
* Fixed a random crasher in VersionedDocument (#1188)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants