You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bookkeeper.apache.org by "wenbingshen (via GitHub)" <gi...@apache.org> on 2023/06/26 09:53:40 UTC

[GitHub] [bookkeeper] wenbingshen commented on pull request #3965: [fix] Keep entryLogMeta when entryLogFile deletion fails

wenbingshen commented on PR #3965:
URL: https://github.com/apache/bookkeeper/pull/3965#issuecomment-1607113309

   > Is it easy to add a test to cover this change?
   
   @hangc0276 In the modification of PR, there are two cases.
   In case1, we return true when the entryLog file does not exist, which helps us remove the corresponding meta information from the entryLogMeta of the GC object. For the entryLogFile file to be deleted, the impact of the change is small.
   
   In case2, when we perform file deletion operations, deletion failures may occur. This result depends more on the impact between multiple processes, or deletion failures caused by misoperations by system maintenance personnel, such as permissions, file locks changed, etc. It is not easy to simulate this situation within a single bookie process.
   
   Executing the system `remove` function in java native method has a `boolean` return value.
   
   ```java
   JNIEXPORT jboolean JNICALL
   Java_java_io_UnixFileSystem_delete0(JNIEnv *env, jobject this,
                                       jobject file)
   {
       jboolean rv = JNI_FALSE;
   
       WITH_FIELD_PLATFORM_STRING(env, file, ids.path, path) {
           if (remove(path) == 0) {
               rv = JNI_TRUE;
           }
       } END_PLATFORM_STRING(env, path);
       return rv;
   }
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@bookkeeper.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org