Managed Mode: Does SetEntryAt ensure only latest version is stored?

Hey,
I am doing multiple writes with different versions to the same key,
Does SetEntryAt ensure that only the latest version is committed, assuming that NumVersionsToKeep is 1, or will it be the last written key(assuming that there are no ongoing writes with a newer version)?
What would be the behavior if I set NumVersionsToKeep to 2

Specifically:

  • SetEntryAt(k, v, 32) is called
  • After a bit SetEntryAt(k, v2, 10) is called

Will badger store v2 or v?