Configuration and environment details:
Execution context: AWS lambda State Machine(workflow) with several states (mostly lambda functions)
Node Version: 14.x
Couchbase SDK Ver. 2.6.9
Couchbase Server ver. 6.0.x with 2-nodes (dev and test share these equally)
what I suspect may be occurring
Given sequential calls to bucket.get(id) for the same document id the results from the previous call is cached and returned to the subsequent call.
my question
Please provide an example how one would force the SDK to not return the result from the previous, identical request?
If more information is necessary, I offer the details below:
What works as expected and perfectly:
- Prior to execution of the lambda function invoking the workflow above we are interacting and updating the CB cluster a few times before the function invokes the above detailed workflow.
- Then, the workflow is invoked from a calling lambda function
- Within the workflow, data is written to our cluster in several of these states(steps) with no issue.
- Where needed, I am able to read the updates applied previous writes, including the results of a N1QL MERGE statement.
- The workflow completes successfully and returns control to the calling lambda.
- The workflow cannot return anything but confirmation metadata provided by the service
Issue I am experiencing
When the calling lambda receives confirmation the workflow has completed successfully, the function calls:
bucket.get(id)
Although the results are returned, they do not reflect the updates applied as a result of the workflow. I can confirm the results are successfully updated in the cluster by invoking a second http call to our api and/or querying the CB console.
what I have tried
Placing the bucket.get(id) call in a second function within the same JavaScript file - does not resolve
Cloning the original connection to a second bucket and invoking bucket2.get(id) - does not resolve
Is there a way to clear cached results from identical calls from the SDK bucket.get(id)?
Please note:
Although I appreciate the encouragement to do so, we do not have the bandwidth yet to upgrade to any version above 6.0.x. If the code we have written to Node SDK ver. 2.6.x is compatible with later versions with little or no updates, then I would be interested. Also, if we can update out CB server to the latest version without breaking us, that too, I would really like to do.
As always, I appreciate any assistance you may offer.
Jay