- rc = llog_write_rec(env, loghandle, rec, NULL, idx, th);
+ if (need_cookie) {
+ struct llog_thread_info *lti = llog_info(env);
+
+ /* cookie comes from llog_process_thread */
+ rc = llog_write_rec(env, loghandle, rec, <i->lgi_cookie,
+ rec->lrh_index, th);
+ /* upper layer didn`t pass cookie so change rc */
+ rc = (rc == 1 ? 0 : rc);
+ } else {
+ rc = llog_write_rec(env, loghandle, rec, NULL, idx, th);
+ }
+