Browse Source

Some chunk reincarnator improvements

- add some tests for versioned chunks
- add config option to skip versioned chunks
- more reliable check for concurrent dynamic table mount
b0f8fb06df6f8da740ec197cdfd178ca19374f7f
kvk1920 11 months ago
parent
commit
3a5046abc1

+ 1 - 1
yt/yt/client/driver/query_commands.cpp

@@ -182,7 +182,7 @@ void TReadQueryResultCommand::DoExecute(ICommandContextPtr context)
         New<TControlAttributesConfig>(),
         /*keyColumnCount*/ 0);
 
-    writer->Write(rowset->GetRows());
+    Y_UNUSED(writer->Write(rowset->GetRows()));
     WaitFor(writer->Close())
         .ThrowOnError();
 }

+ 2 - 2
yt/yt/client/driver/queue_commands.cpp

@@ -147,7 +147,7 @@ void TPullQueueCommand::DoExecute(ICommandContextPtr context)
     auto output = context->Request().OutputStream;
     auto writer = CreateSchemafulWriterForFormat(format, result->GetSchema(), output);
 
-    writer->Write(result->GetRows());
+    Y_UNUSED(writer->Write(result->GetRows()));
 
     WaitFor(writer->Close())
         .ThrowOnError();
@@ -211,7 +211,7 @@ void TPullConsumerCommand::DoExecute(ICommandContextPtr context)
     auto output = context->Request().OutputStream;
     auto writer = CreateSchemafulWriterForFormat(format, result->GetSchema(), output);
 
-    writer->Write(result->GetRows());
+    Y_UNUSED(writer->Write(result->GetRows()));
 
     WaitFor(writer->Close())
         .ThrowOnError();

+ 5 - 5
yt/yt/client/driver/table_commands.cpp

@@ -837,7 +837,7 @@ void TSelectRowsCommand::DoExecute(ICommandContextPtr context)
     auto output = context->Request().OutputStream;
     auto writer = CreateSchemafulWriterForFormat(format, rowset->GetSchema(), output);
 
-    writer->Write(rowset->GetRows());
+    Y_UNUSED(writer->Write(rowset->GetRows()));
 
     WaitFor(writer->Close())
         .ThrowOnError();
@@ -1104,7 +1104,7 @@ void TLookupRowsCommand::DoExecute(ICommandContextPtr context)
             .ValueOrThrow()
             .Rowset;
         auto writer = CreateVersionedWriterForFormat(format, rowset->GetSchema(), output);
-        writer->Write(rowset->GetRows());
+        Y_UNUSED(writer->Write(rowset->GetRows()));
         WaitFor(writer->Close())
             .ThrowOnError();
     } else {
@@ -1117,7 +1117,7 @@ void TLookupRowsCommand::DoExecute(ICommandContextPtr context)
             .ValueOrThrow()
             .Rowset;
         auto writer = CreateSchemafulWriterForFormat(format, rowset->GetSchema(), output);
-        writer->Write(rowset->GetRows());
+        Y_UNUSED(writer->Write(rowset->GetRows()));
         WaitFor(writer->Close())
             .ThrowOnError();
     }
@@ -1183,12 +1183,12 @@ void TPullRowsCommand::DoExecute(ICommandContextPtr context)
 
     if (pullResult.Versioned) {
         auto writer = CreateVersionedWriterForFormat(format, pullResult.Rowset->GetSchema(), output);
-        writer->Write(ReinterpretCastRange<TVersionedRow>(pullResult.Rowset->GetRows()));
+        Y_UNUSED(writer->Write(ReinterpretCastRange<TVersionedRow>(pullResult.Rowset->GetRows())));
         WaitFor(writer->Close())
             .ThrowOnError();
     } else {
         auto writer = CreateSchemafulWriterForFormat(format, pullResult.Rowset->GetSchema(), output);
-        writer->Write(ReinterpretCastRange<TUnversionedRow>(pullResult.Rowset->GetRows()));
+        Y_UNUSED(writer->Write(ReinterpretCastRange<TUnversionedRow>(pullResult.Rowset->GetRows())));
         WaitFor(writer->Close())
             .ThrowOnError();
     }

+ 2 - 2
yt/yt/client/table_client/unversioned_writer.h

@@ -22,12 +22,12 @@ struct IUnversionedRowsetWriter
     /*!
      *  Writes given rows.
      *
-     *  The returned value is |true| iff one can write next rowset immediately,
+     *  The returned value is |true| if one can write next rowset immediately,
      *  otherwise one should wait for |GetReadyEvent()| future.
      *
      *  Every row must contain exactly one value for each column in schema, in the same order.
      */
-    virtual bool Write(TRange<TUnversionedRow> rows) = 0;
+    [[nodiscard]] virtual bool Write(TRange<TUnversionedRow> rows) = 0;
 };
 
 DEFINE_REFCOUNTED_TYPE(IUnversionedRowsetWriter)

+ 1 - 1
yt/yt/client/table_client/value_consumer.cpp

@@ -343,7 +343,7 @@ TFuture<void> TWritingValueConsumer::Flush()
                     .ThrowOnError();
             }
 
-            writer->Write(rows);
+            Y_UNUSED(writer->Write(rows));
             rowBuffer->Clear();
             return writer->GetReadyEvent();
         })

+ 1 - 1
yt/yt/client/table_client/versioned_writer.h

@@ -27,7 +27,7 @@ struct IVersionedWriter
      *  The caller must wait for asynchronous flag provided by #GetReadyEvent to become set.
      *  The latter may indicate an error occurred while fetching more data.
      */
-    virtual bool Write(TRange<TVersionedRow> rows) = 0;
+    [[nodiscard]] virtual bool Write(TRange<TVersionedRow> rows) = 0;
 };
 
 DEFINE_REFCOUNTED_TYPE(IVersionedWriter)