edit-icon download-icon

Max Version Offset

Last Updated: Apr 23, 2018

Max Version Offset is a data table attribute that is measured in seconds. To prevent the writing of unexpected data, the server checks the attribute columns’ versions when processing writing requests. Writing data to a specified row fails if the row has an attribute column in which:

  • Its version is earlier than the current writing time minus the value of Max Version Offset.

  • Its version is later than or equal to the current writing time plus the value of Max Version Offset.

The valid version range for attribute columns is [Data written time – the value of Max Version Offset, Data written time + the value of Max Version Offset). The data written time is the sum of the seconds counted from 1970-01-01 00:00:00 UTC to the time when data is written. Versions of the attribute columns (expressed in milliseconds) must, after being divided by 1000 and converted to seconds, fall into the valid version range.

For example, if the valid version range of a data table is 86400 (one day), then at 2016-07-21 00:00:00 UTC, only data with versions later than 1468944000000 (converted to seconds to get 2016-07-20 00:00:00 UTC) but earlier than 1469116800000 (converted to seconds to get 2016-07-22 00:00:00 UTC) can be written to the data table. If a row has an attribute column whose version is 1468943999000 (converted to seconds to get 2016-07-19 23:59:59 UTC, which is less than a day), the data cannot be written to the row.

Max Version Offset must be set to a non-zero value based on the number of seconds during the period from 1970-01-01 00:00:00 UTC to the current date and time.

If you do not set the value of Max Version Offset when creating a data table, the data table uses the default value 86400.

After creating a data table, you can use the UpdateTable operation to dynamically change the value.

Thank you! We've received your feedback.