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
Return correct timestamp in the VersionItem returned by write when recursive normalizers are used (#2209)
#### Reference Issues/PRs
The issue was reported by users using recursive normalizers. The write
method
```python
v2lib._nvs.write(..., recursive_normalizers=True)
```
return a VersionedItem whose timestamp is 0.
#### What does this implement or fix?
This PR is split into two commits.
1. First commit moves all recursive normalizers unit tests from
`python/tests/integration/arcticdb/version_store/test_basic_version_store.py`
to
`python/tests/unit/arcticdb/version_store/test_recursive_normalizers.py`
2. The second commit implements the actual fix:
* Python code change: set the timestamp from the VersionedItem returned
by the C++ layer. The C++ layer uses the MULTI_KEY to create a
VersionItem
* This also changes the read side when reucrsive normalizers are used.
Prior this change when a read with recursive normalizers was done it
used one of the TABLE_INDEX keys to create versioned item. There wasn't
any particular reasoning for whose TABLE_INDEX key to select. Since
both index keys are created at different times this desn't reflect well
the write timestamp. Now it uses the MULTI_KEY to create the
VersionedItem. This way both read and write will return the same
VersionedItem (except the data as write does not return data) and will
also have a single deterministic timestamp for all symbols.
* Add minor improvements such as reserving space for vectors with known
sizes.
* Remove `test_simple_recursive_normalizer` as it is repetitive
#### Any other comments?
Interesting remark related to creating versioned items. When doing
regular read and write we create a versioned item based on the
INDEX_DATA key and not based on the VERSION key. I find this a bit
misleading mainly due to the name `VersionedItem`.
#### Checklist
<details>
<summary>
Checklist for code changes...
</summary>
- [ ] Have you updated the relevant docstrings, documentation and
copyright notice?
- [ ] Is this contribution tested against [all ArcticDB's
features](../docs/mkdocs/docs/technical/contributing.md)?
- [ ] Do all exceptions introduced raise appropriate [error
messages](https://docs.arcticdb.io/error_messages/)?
- [ ] Are API changes highlighted in the PR description?
- [ ] Is the PR labelled as enhancement or bug so it appears in
autogenerated release notes?
</details>
<!--
Thanks for contributing a Pull Request to ArcticDB! Please ensure you
have taken a look at:
- ArcticDB's Code of Conduct:
https://github.com/man-group/ArcticDB/blob/master/CODE_OF_CONDUCT.md
- ArcticDB's Contribution Licensing:
https://github.com/man-group/ArcticDB/blob/master/docs/mkdocs/docs/technical/contributing.md#contribution-licensing
-->
0 commit comments