'Increment and return the counter position for this device.
TODO-BLOCKER(jamalex): While from testing, this new version seems much less prone to race conditions,
it still seems like a possibility. Further testing would be good.'

@transaction.commit_on_success
def increment_counter_position(self):

    metadata = self.get_metadata()
    metadata.counter_position = (F('counter_position') + 1)
    metadata.save()
    return self.get_metadata().counter_position
