Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rsync subprocess exits immediately and the file count number not match #36

Open
idlej opened this issue Aug 11, 2020 · 4 comments
Open

Comments

@idlej
Copy link

idlej commented Aug 11, 2020

Hi all,

I create a parsyncfp job to migrate about 4T files with a 4G chunksize.

perl /opt/parsyncfp/parsyncfp --NP=10 --altcache=/root/.parsyncfp/jiaoyu_gv_upload --startdir=/mnt/ps15 jiaoyu_gv_upload /mnt/hw_9000 --maxload=32 --verbose=3 --chunksize=4G --interface=eth4

The rsync process starts and exits immediately after the corresponding cachefile is created.
The fpart log tells the cachefile a huge size

[root@ostor-zzj fpcache]# cat fpart.log.09.34.13_2020-08-11
Examining filesystem...
Filled part #0: size = 4294972562, 388939 file(s)
Filled part #1: size = 4294970326, 528222 file(s)
Filled part #2: size = 4294971458, 533180 file(s)
Filled part #3: size = 4294977049, 481518 file(s)
Filled part #4: size = 4294967610, 479615 file(s)
Filled part #5: size = 4294972108, 491070 file(s)
Filled part #6: size = 4294967691, 448095 file(s)

But actually there are only few lines in the cachefiles.

[root@ostor-zzj fpcache]# wc -l f*
   246 f.0
  1982 f.1
  1033 f.2
  1712 f.3
  1331 f.4
   614 f.5
   636 f.6
  2108 f.7
     8 fpart.log.09.34.13_2020-08-11
  9670 total

There are only small size of files be sent.

[root@ostor-zzj jiaoyu_gv_upload]# cat rsync-logfile-09.34.13_2020-08-11_*
2020/08/11 09:34:19 [8718] building file list
2020/08/11 09:34:19 [8718] sent 14196 bytes  received 17 bytes  total size 3123551
2020/08/11 09:43:48 [11469] building file list
2020/08/11 09:43:52 [11469] sent 50222 bytes  received 17 bytes  total size 15715093
2020/08/11 09:49:04 [13024] building file list
2020/08/11 09:49:09 [13024] sent 31495 bytes  received 17 bytes  total size 8388468
2020/08/11 09:54:41 [14649] building file list
2020/08/11 09:54:45 [14649] sent 44404 bytes  received 17 bytes  total size 13828482
2020/08/11 09:59:28 [16039] building file list
2020/08/11 09:59:32 [16039] sent 35528 bytes  received 17 bytes  total size 12950497
2020/08/11 10:04:12 [17434] building file list
2020/08/11 10:04:13 [17434] sent 16247 bytes  received 17 bytes  total size 5056321
2020/08/11 10:08:45 [18741] building file list
2020/08/11 10:08:47 [18741] sent 17912 bytes  received 17 bytes  total size 5144628
2020/08/11 10:12:27 [19802] building file list
2020/08/11 10:12:32 [19802] sent 58061 bytes  received 17 bytes  total size 23893062
2020/08/11 10:15:15 [20632] building file list
2020/08/11 10:15:17 [20632] sent 2398 bytes  received 17 bytes  total size 831982

I think the problem may be that the rsync starts when the corresponding cachefile just created and the rsync won't wait for the cachefile generating complete.

I don't know if this is the expected scenario and how to fix this.

@hjmangalam
Copy link
Owner

hjmangalam commented Aug 11, 2020 via email

@idlej
Copy link
Author

idlej commented Aug 11, 2020

@hjmangalam

Hi Harry,
I use fpart v1.2.0, rsync version 3.1.2 protocol version 31 and parsyncfp version 1.67.

I understand the strategy that rsync is fired off with the completed chunk file as soon as it is done.
But in my case, the rsync is fired when the chunk just been created. And in the code the condition to fork a new rsnyc process is just the existance of the new chunkfile.

while ( $RSYNCS_GOING < $NP && $KEEPGOING ) {    #
  $CUR_FP_FLE = $FP_ROOT . "." . $CUR_FPI;       # the current fp chunkfile
  if ( -e $CUR_FP_FLE ) {                        # if the current chunkfile exists  <----------------------
    fixfilenames( $CUR_FP_FLE, $ROOTDIR );       # check & fix for spaces, bad chars.
         # entire rsync command and PID capture (used in total of 2 places)
    $logfile = $bytefiles . $CUR_FPI;
    $RSYNC_CMD =
"cd $TRIMPATH && rsync  --bwlimit=$MAXBW  $RSYNCOPTS -a -s --log-file=$logfile --files-from=$CUR_FP_FLE  $ROOTDIR  $TARGET  & echo \"\${!}\" >> $PIDFILE";
    if ( $VERBOSE >= 2 ) { INFO("Starting rsync for chunkfile [$CUR_FP_FLE]..\n"); }
    # WARN("$RSYNC_CMD");
    # there will be as many logfiles as fp chunkfiles.
    # ie LOTS. but they can be deleted after the run has been verified..
    # TODO don't know if we need this logfile.
    if ($DEBUG) { debug( __LINE__, "Complete rsync cmd = [$RSYNC_CMD]" ); }
    system("$RSYNC_CMD");    # launch rsync and capture the bg job PID to PIDfile

I don't know if any version of rsync will watch the chunkfile and process the newly appended lines after the chunkfile opened.
But in my case it seems the rsync just handle the few lines then exit.

And it's also quiet strange the fpart stopped to write to the chunkfile.

@hjmangalam
Copy link
Owner

hjmangalam commented Aug 12, 2020 via email

@hjmangalam
Copy link
Owner

hjmangalam commented Aug 13, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants