Both PyDCP and Wireshark report that when streaming expired items with xattr's without using the xattr flag, some appear as deletions while some retain the expiry opcode.
Method to replicate:
- Insert n items with xattr's
- Touch each item with an expiry time
- Wait/sleep past the expiry time
- Get/lookup each item to trigger expiration of that item
- Start a DCP stream without the xattr flag
- DCP control the enable expiry opcodes on
- You'll get a mix of deletions and expirations.
If you stream with the xattr flag on, you'd get all expirations. Also, the stat for expired documents (vb_active_expired) is correct so it appears that the items are being expired correctly.
As far as I can tell, the opcode for the same key is not guaranteed to be the same on repeated DCP stream attempts (without changing the items) which is definitely not expected behaviour. I have managed to manually demonstrate this on both couchbase and ephemeral buckets.