Skip to content

fix: Update view version log timestamp for historical accuracy #1218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 18, 2025

Conversation

c-thiel
Copy link
Collaborator

@c-thiel c-thiel commented Apr 15, 2025

What changes are included in this PR?

This change updates the behavior when setting a view version as current. When we set a previously existing view version as current, we now update its log timestamp to the current time rather than reusing the original timestamp of the ViewVersion.

Lets assume the following changes:

  1. ViewVersion 1 is added and set active
  2. View Version 2 is added and set active
  3. View Version 1 is set active.

This resulted in the following version_log:

    "version-log": [
        {
            "version-id": 1,
            "timestamp-ms": 1744716416168
        },
        {
            "version-id": 2,
            "timestamp-ms": 1744716449754
        },
        {
            "version-id": 1,
            "timestamp-ms": 1744716416168
        }
    ],

Note that the last and first entries have the same timestamp, namely the time stamp of the initial ViewVersion creation.

I believe this is undesired in a history, where we are interested when a certain change became active. It makes sense to use the exact timestamp of the ViewVersion if it was added in the same set of changes, but re-enabling a previously used view version (maybe years ago) should not add a history for this past timestamp.

Java behaviors the same way as rust currently does. @Fokko @nastra if we agree that we should change the behavior, we should also touch Java.

Are these changes tested?

Yes

@nastra
Copy link
Contributor

nastra commented Apr 16, 2025

nice find @c-thiel and yes I agree that this seems like a bug that we should also fix on the Java side

Copy link
Contributor

@liurenjie1024 liurenjie1024 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @c-thiel for this fix, LGTM!

@liurenjie1024
Copy link
Contributor

Let's wait for a while for @Fokko 's response.

@sdd
Copy link
Contributor

sdd commented Apr 17, 2025

Agree, this seems like the desired behaviour.

@liurenjie1024 liurenjie1024 merged commit e497fb1 into apache:main Apr 18, 2025
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants