1

I can't understand how Couchbase bucket ejection methods exactly works. Db version is 7.0.3 enterprise.

It has two methods as value-only and full. It says with full ejection, everything is deleted including metadata. However when you delete document and recreate it with same id, its metadata revision number is increased instead of resetting. Example scenario I tried:

Document created with id as "foo"
"rev": "1-174c39a795a800000000000002000006",

updated the document(rev number is increased as expected):
"rev": "2-174c39b2dd1000000000000002000006"

deleted and recreated and id "foo" again(that is the problem):
"rev": "4-174c39b96cfe00000000000002000006",

As you can see, even in full ejection mode, couchbase won't delete metadata and revision number is increased from old one. (2 to 4). Does not matter where I delete it, java api, ui itself, eventing etc, same result.

How do you explain that? Am I missing something?

Matthew Groves
  • 25,181
  • 9
  • 71
  • 121
sarah
  • 580
  • 1
  • 6
  • 24
  • 2
    I don't know the answer sorry, but I am curious why it matters: what are you trying to do that you don't want a revision number reused? – Matthew Groves Mar 14 '23 at 14:10
  • 1
    I tried few scenarios. Both value only and full behaves same which is weird. Then I tried with two buckets(say A and B) and eventing function. If doc is removed from A, function removes it from B. In that case, full ejection reused rev while value only recreated it. I simply cannot interpret its behavior when deletion occures from different sources like eventing, UI, or api. – sarah Mar 14 '23 at 20:47
  • 1
    Why it matters, we use two clusters. Clusters have unidirectional XDCR that depends on revision number for conflict resolution. Timestamp is not an option. So problem if we remove document in source cluster, it removes it from other. If second cluster won't remove metadata, when source recreate original document with same id, the doc might not be replicated because its revision number is already bigger than source. So I am trying to figure out how it works exactly in any deletion scenario with different ejection methods – sarah Mar 14 '23 at 20:52

1 Answers1

2

Ejection is about removing documents/metadata from the in-memory cache. The documents/metadata are still present on disk (unless the bucket type is "ephemeral").

dnault
  • 8,340
  • 1
  • 34
  • 53