Skip to content

Commit f6db007

Browse files
pimpinclaude
andcommitted
Configure metadata purge interval to 1 hour in CBS setup
The previous Docker configuration did not explicitly set the metadata purge interval, relying on CBS default (3 days). This made tombstone purge testing impractical. Changes: - Add configureBucketCompaction() function to set metadata purge interval - Set to 0.04 days (1 hour) - the CBS minimum per documentation - Execute during initial cluster setup after bucket creation - Add explicit logging for this configuration step This configuration is critical for testing tombstone behavior with Sync Gateway, as it controls when tombstones are permanently removed from CBS after deletion. With the default 3-day interval, testing would require waiting days to observe purge behavior. The 1-hour minimum allows practical testing while respecting CBS constraints. References: - Couchbase docs: metadata purge interval minimum is 0.04 days (1 hour) - Thomas's recommendation in ticket 70596 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
1 parent c073f30 commit f6db007

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

examples/docker-conf/couchbase-server-dev/configure-server.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,21 @@ function bucketCreate() {
4949
fi
5050
}
5151

52+
function configureBucketCompaction() {
53+
# Configure metadata purge interval to 1 hour (0.04 days) - CBS minimum
54+
# This is important for tombstone purge testing with Sync Gateway
55+
# Default is 3 days, which is too long for testing
56+
couchbase-cli setting-compaction \
57+
-c 127.0.0.1:8091 \
58+
--username $COUCHBASE_ADMINISTRATOR_USERNAME \
59+
--password $COUCHBASE_ADMINISTRATOR_PASSWORD \
60+
--bucket $COUCHBASE_BUCKET \
61+
--metadata-purge-interval 0.04
62+
if [[ $? != 0 ]]; then
63+
return 1
64+
fi
65+
}
66+
5267
function userSgCreate() {
5368
couchbase-cli user-manage \
5469
-c 127.0.0.1:8091 \
@@ -101,6 +116,15 @@ function main() {
101116
echo "Creating the bucket [OK]"
102117
echo
103118

119+
echo "Configuring bucket compaction settings...."
120+
retry configureBucketCompaction
121+
if [[ $? != 0 ]]; then
122+
echo "Bucket compaction config failed. Exiting." >&2
123+
exit 1
124+
fi
125+
echo "Configuring bucket compaction settings [OK]"
126+
echo
127+
104128
echo "Creating Sync Gateway user...."
105129
retry userSgCreate
106130
if [[ $? != 0 ]]; then

0 commit comments

Comments
 (0)