Kevin,

Can you try the attached patch?

Jean-Louis

Kevin Zembower wrote:
Sorry this has taken so long. Thank you for any help or advice you can provide.

-Kevin

On Wed, 2010-12-22 at 07:15 -0500, Jean-Louis Martineau wrote:
Kevin,

Post the amdump.? log file, I want to look at it.

Jean-Louis

Kevin Zembower wrote:
> I'm having problems when I try to set amanda up to completely fill my
> tapes. One of my disklist entries is about 600GB at level 0. I'm using
> amanda 3.2.1 on a RHEL5 tapehost with Ultrium tapes that hold 200GB. I
> set:
>   flush-threshold-dumped 100
>   flush-threshold-scheduled 100
>   taperflush 100
>   autoflush yes
>
> When I watch amstatus, I see the big DLE tape tape up to 100%, but then
> it reports a PARTIAL tape. Then all the other DLEs waiting to tape
> report "process canceled waiting to be taped" and they stay on the
> holding disk. The report states that 602GB were left on the holding
> disk.
>
> When I set the three variables to 0, taping proceeds normally, and the
> big DLE and the rest of the DLEs span four tapes correctly. However,
> most of the time, the tapes are only filled to less than 5%.
>
> Any suggestions on what I can do to fill tapes to capacity? Thanks for
> your help and suggestions.
>
> -Kevin
>
>


diff --git a/server-src/driver.c b/server-src/driver.c
index 51b55db..bfccdab 100644
--- a/server-src/driver.c
+++ b/server-src/driver.c
@@ -3703,11 +3703,10 @@ tape_action(
     off_t sched_size;
     off_t dump_to_disk_size;
     int   dump_to_disk_terminated;
-    off_t my_flush_threshold_dumped;
-    off_t my_flush_threshold_scheduled;
-    off_t my_taperflush;
     int   nb_taper_active = nb_sent_new_tape;
     int   nb_taper_flushing = 0;
+    off_t data_next_tape = 0;
+    off_t data_lost = 0;
 
     dumpers_size = 0;
     for(dumper = dmptable; dumper < (dmptable+inparallel); dumper++) {
@@ -3748,11 +3747,19 @@ tape_action(
 	    tapeq_size -= taper1->left;
 	}
 	if (taper1->disk) {
+	    off_t data_to_go;
 	    if (taper1->dumper) {
-		tapeq_size += sched(taper1->disk)->est_size - taper1->written;
+		data_to_go = sched(taper1->disk)->est_size - taper1->written;
 	    } else {
-		tapeq_size += sched(taper1->disk)->act_size - taper1->written;
+		data_to_go = sched(taper1->disk)->act_size - taper1->written;
 	    }
+	    data_next_tape += data_to_go - taper1->left;
+	    if (data_to_go > taper1->left) {
+		data_lost += taper1->written - taper1->left;
+	    } else {
+		data_lost += data_to_go - taper1->left;
+	    }
+	    tapeq_size += data_to_go;
 	}
     }
     driver_debug(1, _("tapeq_size: %lld\n"), (long long)tapeq_size);
@@ -3771,19 +3778,6 @@ tape_action(
 	    nb_taper_active++;
 	}
     }
-    if (nb_taper_active >= 1) {
-    my_flush_threshold_dumped = flush_threshold_dumped +
-				(nb_taper_active-nb_taper_active) * tape_length;
-    my_flush_threshold_scheduled = flush_threshold_scheduled +
-				   (nb_taper_active-nb_taper_active) * tape_length;
-    my_taperflush = taperflush + (nb_taper_active-nb_taper_active) * tape_length;
-    } else {
-    my_flush_threshold_dumped = flush_threshold_dumped +
-				nb_taper_active * tape_length;
-    my_flush_threshold_scheduled = flush_threshold_scheduled +
-				   nb_taper_active * tape_length;
-    my_taperflush = taperflush + nb_taper_active * tape_length;
-    }
 
     // Changing conditionals can produce a driver hang, take care.
     // 
@@ -3796,8 +3790,9 @@ tape_action(
 	    result |= TAPE_ACTION_NO_NEW_TAPE;
 	} else if (current_tape < conf_runtapes &&
 		   taper_nb_scan_volume == 0 &&
-		   ((my_flush_threshold_dumped < tapeq_size &&
-		     my_flush_threshold_scheduled < sched_size) ||
+		   ((flush_threshold_dumped < tapeq_size &&
+		     flush_threshold_scheduled < sched_size) ||
+		    (data_lost > data_next_tape) ||
 		    nb_taper_active == 0) &&
 		   (last_started_taper == NULL ||
 		    last_started_taper == taper)) {
@@ -3810,16 +3805,17 @@ tape_action(
 	 !empty(directq) ||				// if a dle is waiting for a dump to tape
          !empty(roomq) ||				// holding disk constraint
          idle_reason == IDLE_NO_DISKSPACE ||		// holding disk constraint
-         (my_flush_threshold_dumped < tapeq_size &&	// flush-threshold-dumped &&
-	  my_flush_threshold_scheduled < sched_size) ||	//  flush-threshold-scheduled
-	 (my_taperflush < tapeq_size &&			// taperflush
+         (flush_threshold_dumped < tapeq_size &&	// flush-threshold-dumped &&
+	  flush_threshold_scheduled < sched_size) ||	//  flush-threshold-scheduled
+	 (data_lost > data_next_tape) ||
+	 (taperflush < tapeq_size &&			// taperflush
 	  (force_flush == 1 ||				//  if force_flush
 	   dump_to_disk_terminated))			//  or all dump to disk terminated
 	)) {
 	result |= TAPE_ACTION_NEW_TAPE;
     // when to stop using new tape
     } else if ((taper->state & TAPER_STATE_WAIT_FOR_TAPE) &&
-	       (my_taperflush >= tapeq_size &&		// taperflush criteria
+	       (taperflush >= tapeq_size &&		// taperflush criteria
 	       (force_flush == 1 ||			//  if force_flush
 	        dump_to_disk_terminated))		//  or all dump to disk
 	      ) {
@@ -3840,9 +3836,9 @@ tape_action(
 	    (taper->state & TAPER_STATE_TAPE_STARTED ||		// tape already started 
              !empty(roomq) ||					// holding disk constraint
              idle_reason == IDLE_NO_DISKSPACE ||		// holding disk constraint
-             (my_flush_threshold_dumped < tapeq_size &&		// flush-threshold-dumped &&
-	      my_flush_threshold_scheduled < sched_size) ||	//  flush-threshold-scheduled
-             (force_flush == 1 && my_taperflush < tapeq_size))) {	// taperflush if force_flush
+             (flush_threshold_dumped < tapeq_size &&		// flush-threshold-dumped &&
+	      flush_threshold_scheduled < sched_size) ||	//  flush-threshold-scheduled
+             (force_flush == 1 && taperflush < tapeq_size))) {	// taperflush if force_flush
 
 	    if (nb_taper_flushing == 0) {
 		result |= TAPE_ACTION_START_A_FLUSH;

Reply via email to