Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
173 views
in Technique[技术] by (71.8m points)

Google-Cloud-Storage | Artifactory does not delete objects in bucket

We are currently in the process of setting up an Artifactory Pro instance on GCP and want to use GCS as its Filestore. The connection to the bucket is successful, uploads and downloads to and from the bucket via Artifactory are successful (using a generic repo).

However: Artifactory does not delete an artifact if we tell it so, via the GUI. The Artifact gets deleted and disappears in the GUI, (Trash Can is disabled in the System Settings) but continues to exist in the bucket in GCS.

This is our binarystore.xml:

<?xml version="1.0" encoding="UTF-8"?>
<config version="v1">
<chain>
   <provider id="cache-fs" type="cache-fs">
       <provider id="eventual" type="eventual">
           <provider id="retry" type="retry">
               <provider id="google-storage" type="google-storage"/>
           </provider>
       </provider>
   </provider>
</chain>

<provider id="google-storage" type="google-storage">
   <endpoint>commondatastorage.googleapis.com</endpoint>
    <bucketName>rtfdev</bucketName>
   <identity>xxx</identity>
   <credential>xxx</credential>
   <bucketExists>false</bucketExists>
   <httpsOnly>true</httpsOnly>
   <httpsPort>443</httpsPort>
</provider>
</config>

Our setup:

  • Artifactory 7.12.6
  • OS: Debian 10 (buster)
  • Machine Type: e2-highcpu-4 (4 vCPUs, 4 GB memory)
  • Disk: 200 GB SSD

The questions are:.

  • Is this working as intended? Does Artifactory never ever delete artifacts in a bucket?
  • On a related note: How can we convince Artifactory to be more verbose with its interactions with GCS? (the artifactory-binarystore.log is suspiciously empty, console.log is quiet as well...)
question from:https://stackoverflow.com/questions/65829184/google-cloud-storage-artifactory-does-not-delete-objects-in-bucket

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The reason you are not seeing the artifact being deleted immediately from the storage is the fact that Artifactory is using a checksum based storage.
TL;DR - you will see the artifact deleted from storage once the garbage collection process will delete it.

Artifactory stores any binary file only once. This is what we call "once and once only storage". First time a file is uploaded, Artifactory runs the required checksum calculations when storing the file, however, if the file is uploaded again (to a different location, for example), the upload is implemented as a simple database transaction that creates another record mapping the file's checksum to its new location. There is no need to actually store the file again in storage. No matter how many times a file is uploaded, the filestore only hosts a single copy of the file.
Deleting a file is also a simple database transaction in which the corresponding database record is deleted. The file itself is not directly deleted, even if the last database entry pointing to it is removed. So-called "orphaned" files are removed in the background by Artifactory's garbage collection processes.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...