scylla-tools-java icon indicating copy to clipboard operation
scylla-tools-java copied to clipboard

sstableloader returns exit code 0 even if writes failed

Open tgrabiec opened this issue 8 years ago • 2 comments

It prints errors on stderr, but still will returns a success. May be a problem when this is run through some automation.

Relevant code in BulkLoader.java:

                semaphore.acquire();
                try {
                    ResultSetFuture future = session.executeAsync(s);
                    Futures.addCallback(future, new FutureCallback<ResultSet>() {
                        @Override
                        public void onSuccess(ResultSet result) {
                            semaphore.release();
                        }

                        @Override
                        public void onFailure(Throwable t) {
                            semaphore.release();
                            System.err.println(t);
                        }
                    }, MoreExecutors.directExecutor());
                } finally {
                }

tgrabiec avatar Jun 23 '17 19:06 tgrabiec

@Orenef11 reported the same bug while writing a test for #220 and #230. Although syntax errors are reported during the sstableloader run (because of a bug that caused invalid CQL to be generated), at the end of the run sstableloader seemingly reports success, shows a count of partitions supposedly loaded, and returns exit code 0 - while it actually didn't manage to write anything.

nyh avatar Mar 09 '21 09:03 nyh

The Scylla version is 2021-02-15T01:57:05Z (4.5) The example of output returned from the command (the result code is 0) are :

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

...
...
...

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

com.datastax.driver.core.exceptions.SyntaxError: line 1:49  : missing elements...

100% done.        0 statements sent (in        0 batches,        0 failed).
    2000 statements generated.
    4000 cql rows processed in     2000 partitions.
       0 cql rows and        0 partitions deleted.
       0 local and        0 remote counter shards where skipped.

Orenef11 avatar Mar 09 '21 13:03 Orenef11