You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote below script watching path "/demo", it suppose to append a prefix "Hello" when the content in that path changed. Then I triggered a change on another node. But as a result, the "etcdctl get" command always got the old value of path "/demo", not the changed one.
while true; do
etcdctl watch ${KEY}
etcdctl update ${KEY} "Hello $(etcdctl get ${KEY})"
done
However, after I put a bit delay before getting the value of path, it begin to work as expected.
while true; do
etcdctl watch ${KEY}
sleep 1s # <-- wait 1s here
etcdctl update ${KEY} "Hello $(etcdctl get ${KEY})"
done
So from appearance, the reason is when "etcdctl watch" command returned, etcd is still under synchronisation process and not ready to provide the new value.
Is this a designed behaviour or unexpected issue?
The text was updated successfully, but these errors were encountered:
Hi,
I wrote below script watching path "/demo", it suppose to append a prefix "Hello" when the content in that path changed. Then I triggered a change on another node. But as a result, the "etcdctl get" command always got the old value of path "/demo", not the changed one.
However, after I put a bit delay before getting the value of path, it begin to work as expected.
So from appearance, the reason is when "etcdctl watch" command returned, etcd is still under synchronisation process and not ready to provide the new value.
Is this a designed behaviour or unexpected issue?
The text was updated successfully, but these errors were encountered: