Workers Key-Value reversion issue

#1

Hi All,

I’m trying out the beta key-value feature. Here’s my setup:

My Cloud worker runs this line of code:

const envString = await STAGING.get("current_env");

To get the current environment, I’m then using this for a blue green deployment methodology on Google Cloud Functions (which has no systems in place to make deployments less risky).

I’m updating the value for current_env like this:

await axios({
    method: 'put',
    url: 'https://api.cloudflare.com/client/v4/accounts/***/storage/kv/namespaces/***/values/current_env',
    headers: {
        'X-Auth-Email': '****',
        'X-Auth-Key': '****'
    },
    data: newEnv
});

The key changes from the perspective of the api - I can read the value back with axios after running this PUT and it gives me the new value, however after I run the worker script to read the value it hasn’t updated, and still shows the previous current_env value after multiple tries, waiting a few minutes.

Even stranger, after running the worker script when I then read the current_env variable through the api again, it has switched back from the API’s perspective as well. It almost seems like the action of reading the value from the worker script resets it.

Is this a known issue, given that it’s a beta?

Cheers,
Paul

0 Likes

#2

Do you know the CF-Ray header when calling the API?
I have seen in the passed some inconsistency, but was related to one datacenter.

0 Likes

#3

@tech45 I am now seeing this inconsistency in KV, after deleting a key and putting a new value on a key with the same name comes back the old version. cc @zack

LIS NRT datacenters

Update: delete a key, a minute later comes back.

0 Likes

#4

We have identified this as an incident and our currently working on resolving it. We should have a status page up very shortly. As always thank you for reporting it and I am sorry it took us this long to respond. As we go through beta for KV we are systematically improving our internal alerting and you can trust we will have automated tests around this behavior shortly as well.

3 Likes

#5

This has been resolved, we are beginning working to understand the full root cause and improve our monitoring now.

4 Likes

#6

Maybe this explains the inconsistent behavior I had when testing too.

Thanks for fixing it so quickly.

0 Likes