code: def complete_offset_upload(self, chunk_num):
          # type: (Descriptor, int) -> None
          
          with self._meta_lock:
              self._outstanding_ops -= 1
              # save resume state
              if self.is_resumable:
                  # only set resumable completed if all replicas for this
                  # chunk are complete
                  if blobxfer.util.is_not_empty(self._ase.replica_targets):
                      if chunk_num not in self._replica_counters:
                          # start counter at -1 since we need 1 "extra" for the
                          # primary in addition to the replica targets
                          self._replica_counters[chunk_num] = -1
                      self._replica_counters[chunk_num] += 1
                      if (self._replica_counters[chunk_num] !=
                              len(self._ase.replica_targets)):
                          return
                      else:
                          self._replica_counters.pop(chunk_num)
                  self._completed_chunks.set(True, chunk_num)
                  completed = self._outstanding_ops == 0
                  if not completed and self.must_compute_md5:
                      last_consecutive = (
                          self._completed_chunks.find('0b0')[0] - 1
                      )
                      md5digest = self._md5_cache[last_consecutive]
                  else:
                      md5digest = None
                  self._resume_mgr.add_or_update_record(
                      self.local_path.absolute_path, self._ase, self._chunk_size,
                      self._total_chunks, self._completed_chunks.int, completed,
                      md5digest,
                  )
                  # prune md5 cache
                  if self.must_compute_md5:
                      if completed:
                          self._md5_cache.clear()
                      elif (len(self._md5_cache) >
                            _MD5_CACHE_RESUME_ENTRIES_GC_THRESHOLD):
                          mkeys = sorted(list(self._md5_cache.keys()))
                          for key in mkeys:
                              if key >= last_consecutive:
                                  break
                              self._md5_cache.pop(key)
docs: Complete the upload for the offset
          :param Descriptor self: this
          :param int chunk_num: chunk num completed