How history service moudle process the field 'range_id'

I have not seen history service moudle processes the field ‘range_id’。
As I have seen ‘range_id’ in shard_info table, but not in execution table or transfer_tasks table, they are not in same shading db, so how to guarantee the version of ‘range_id’

range ID is used for shard ownership
whenever a history process need to modify a workflow (workflow belong to shard), the range ID will be checked as part of a DB transaction.

e.g.

OK, thanks