CRM-13302 - improve detection of log columns that require rebuilding, and rebuilding mechanism