Details
-
Improvement
-
Resolution: Unresolved
-
Critical
-
6.6.5, 7.0.0, 7.1.0
-
1
Description
I did a fresh install of couchbase-server GA 6.6.5
couchbase-server Enterprise Edition 6.6.5 build 10080
made two BUCKETS: metadata and primary
Did a fresh install of SGW 2.7.3-3
systemctl start sync_gateway
|
And I tested it out (made some docs in "primary") via sync_gateway
All work is done as full admin or user Administrator
I also set "allow_interbucket_recursion": true
curl -s -X GET -u "$CB_USERNAME:$CB_PASSWORD" 'http://localhost:8091/_p/event/api/v1/config' | jq .
|
{
|
"enable_debugger": false,
|
"ram_quota": 256
|
}
|
curl -s -X POST -u "$CB_USERNAME:$CB_PASSWORD" 'http://localhost:8091/_p/event/api/v1/config' -d '{ "allow_interbucket_recursion":true }' | jq .
|
{
|
"restart": false
|
}
|
curl -s -X GET -u "$CB_USERNAME:$CB_PASSWORD" 'http://localhost:8091/_p/event/api/v1/config' | jq .
|
{
|
"allow_interbucket_recursion": true,
|
"enable_debugger": false,
|
"ram_quota": 256
|
}
|
=======
CASE: #1 CREATE FUNCTION WORKS - Create any function in the UI with an initial "Bucket Alias" of "src_bkt" to "primary" in mode read-only
In the Evneting landing page hit "ADD FUNCTION" and fill in
primary
metadata
test_issue_a_ro
Everything
[ binding : bucket alias ]
src_bkt, primary, read-only
I get code editor, no change
"< back to Eventing"
The function saves just fine as expected (see image: 1_test_issue_ro.PNG)
The Function "test_issue_a_ro" will DEPLOY (and run) and UNDEPLOY just fine.
Now when UNDEPLOYED go to settings and change the alias of src_bkt to mode "read and write" and save the altered settings.
Now try to DEPLOY the function "test_issue_a_ro"
The DEPLOY test_issue_a_ro (FAILS) despite setting "allow_interbucket_recursion": true - you will see the below pop-up on 6.6.5 (Note this works just fine on version 6.6.4)
deploy failed: with popup message:
{"code":52,"info":"SyncGateway is enabled on: primary, deployement of source bucket mutating handler will cause Intra Bucket Recursion"}
note deployment is misspelled in the message ^^^^^
=======================
CASE: #2 CREATE FUNCTION FAILS- Create any function in the UI with an initial "Bucket Alias" of "src_bkt" to "primary" in mode read and write
ADD FUNCTION
primary
metadata
test_issue_a_rw
Everything
[ binding : bucket alias ]
src_bkt, primary, read-only
A) I get code editor, no change
"< back to Eventing"
We see "..." for 15 seconds and then the Function disappears or auto deletes (no user error message or feedback happens the user is left baffled)
=======================
CASE: #3 CREATE FUNCTION FAILS- Create any function in the UI with an initial "Bucket Alias" of "src_bkt" to "primary" in mode read and write
ADD FUNCTION
primary
metadata
test_issue_a_rw
Everything
[ binding : bucket alias ]
src_bkt, primary, read-only
Change the code and try to hit "SAVE" nothing happens you are stuck in the code editor (no user error message or feedback happens again the user is left baffled)
=======================
CASE: #1 CASE: #2 and CASE #3 all happen sync_gateway is running and even if I stop SGW via:
systemctl stop sync_gateway
|
But if I also flush the SGW bucket "primary" (with sync_gateway down of course) CASE: #1, CASE: #2 and CASE #3 are fine and all work as expected.
=======================
OTHER:
Now in 6.6.5 you CAN deploy your function with a "read and write" alias to the bucket "primary" shared with SGW with an empty sync_gateway bucket and then start sync_gateway and it appears to work fine
- systemctl stop sync_gateway
- FLUSH primary bucket
- DEPLOY test_issue_a_rw
- systemctl start sync_gateway
Obviously you can not do the above in production as you need to NUKE the sync_gateway bucket every time.
Attachments
Issue Links
- is parent task of
-
DOC-12035 Doc to capture 7.6.2 changes re: deploying eventing functions on a SGW bucket with read-write alias
- Open
Gerrit Reviews
For Gerrit Dashboard: MB-50944 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
205918,9 | MB-50944 : Skip "_sync:" prefixed mutations | unstable | eventing | Status: NEW | 0 | 0 |
205919,10 | MB-50944 : Add cas to _eventing xattr on SBM | unstable | eventing | Status: NEW | 0 | 0 |
206464,13 | MB-50944 : Check for import mutations and address infinite recursion | unstable | eventing | Status: NEW | 0 | 0 |
208845,8 | MB-50944 : Handle duplicate mutations | unstable | eventing | Status: NEW | 0 | 0 |
209037,6 | MB-50944 : Introduce new function level setting "cursor_aware" | unstable | eventing | Status: NEW | +2 | 0 |
209351,4 | MB-50944 : Put limitations on cursor count | unstable | eventing | Status: NEW | 0 | 0 |